@Test public void checkMatch() { final boolean match = KeysMatcher.doKeysMatch(keysActual.keys, keysExpected.keys); assertEquals(matches, match); }
public static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys, final KeyboardEvent.Key... expectedKeys) { if (actualKeys == null) { return expectedKeys == null; } else if (expectedKeys == null) { return false; } if (actualKeys.length != expectedKeys.length) { return false; } final Set<KeyboardEvent.Key> matches = new HashSet<>(); matches.addAll(Arrays.asList(actualKeys)); matches.retainAll(Arrays.asList(expectedKeys)); return matches.size() == expectedKeys.length; }
KeysMatcher { public static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys, final KeyboardEvent.Key... expectedKeys) { if (actualKeys == null) { return expectedKeys == null; } else if (expectedKeys == null) { return false; } if (actualKeys.length != expectedKeys.length) { return false; } final Set<KeyboardEvent.Key> matches = new HashSet<>(); matches.addAll(Arrays.asList(actualKeys)); matches.retainAll(Arrays.asList(expectedKeys)); return matches.size() == expectedKeys.length; } }
KeysMatcher { public static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys, final KeyboardEvent.Key... expectedKeys) { if (actualKeys == null) { return expectedKeys == null; } else if (expectedKeys == null) { return false; } if (actualKeys.length != expectedKeys.length) { return false; } final Set<KeyboardEvent.Key> matches = new HashSet<>(); matches.addAll(Arrays.asList(actualKeys)); matches.retainAll(Arrays.asList(expectedKeys)); return matches.size() == expectedKeys.length; }  }
KeysMatcher { public static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys, final KeyboardEvent.Key... expectedKeys) { if (actualKeys == null) { return expectedKeys == null; } else if (expectedKeys == null) { return false; } if (actualKeys.length != expectedKeys.length) { return false; } final Set<KeyboardEvent.Key> matches = new HashSet<>(); matches.addAll(Arrays.asList(actualKeys)); matches.retainAll(Arrays.asList(expectedKeys)); return matches.size() == expectedKeys.length; }  static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys,
                                      final KeyboardEvent.Key... expectedKeys); static boolean isKeyMatch(final KeyboardEvent.Key[] actualKeys,
                                     final KeyboardEvent.Key... expectedKey); }
KeysMatcher { public static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys, final KeyboardEvent.Key... expectedKeys) { if (actualKeys == null) { return expectedKeys == null; } else if (expectedKeys == null) { return false; } if (actualKeys.length != expectedKeys.length) { return false; } final Set<KeyboardEvent.Key> matches = new HashSet<>(); matches.addAll(Arrays.asList(actualKeys)); matches.retainAll(Arrays.asList(expectedKeys)); return matches.size() == expectedKeys.length; }  static boolean doKeysMatch(final KeyboardEvent.Key[] actualKeys,
                                      final KeyboardEvent.Key... expectedKeys); static boolean isKeyMatch(final KeyboardEvent.Key[] actualKeys,
                                     final KeyboardEvent.Key... expectedKey);  }