import static javafx.scene.input.KeyCode.*; import static javafx.scene.input.KeyEvent.*; import javafx.embed.swing.JFXPanel; import javafx.scene.input.KeyCharacterCombination; import javafx.scene.input.KeyEvent; public class KeyCharacterCombinationTest { public static void main(String[] args) { new JFXPanel(); // initialize JavaFX toolkit KeyCharacterCombination matcher = new KeyCharacterCombination("a"); KeyEvent event = new KeyEvent(KEY_PRESSED, "", "", A, false, false, false, false); if(!matcher.match(event)) { throw new AssertionError("They should have matched"); } } }