@Test public void testIsValid() { AbstractBlacklistStrategy strategy = new CharacterBlacklistStrategy(); List<String> badStringList = createBadStringList(); List<Character> badCharList = createCharacterListFromStringList(badStringList); strategy.setInputCollection(badStringList); strategy.init(); runTestLoop(badCharList, strategy, false); List<String> goodStringList = createGoodStringList(); List<Character> goodCharList = createCharacterListFromStringList(goodStringList); runTestLoop(goodCharList, strategy, true); }
@Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; }
CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } }
CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); }
CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); @Override boolean isValid(String context, String input); }
CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); @Override boolean isValid(String context, String input);  }