UniqueChars { public boolean evaluate(String input) { validateInput(input); Set<Integer> charsCounter = new HashSet<Integer>(); for (char c : input.toCharArray()) { if (charsCounter.contains((int) c)) { return false; } else { charsCounter.add((int) c); } } return true; }  boolean evaluate(String input); boolean evaluate2(String input);  }
@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptNullStringsAsInput() { uniqueChars.evaluate(null); }
@Test public void shouldReturnFalseIfInputStringIsEmpty() { assertTrue(uniqueChars.evaluate("")); }
@Test public void shouldReturnTrueIfInputStringContainsDuplicatedChars() { assertFalse(uniqueChars.evaluate("vicente")); }
@Test public void shouldReturnFalseIfInputStringDoesNotContainDuplicatedChars() { assertTrue(uniqueChars.evaluate("pedro")); }