UniqueChars { public boolean evaluate2(String input) { validateInput(input); int[] chars = new int[256]; for (char c : input.toCharArray()) { if (chars[c] >= 1) { return false; } else { chars[c]++; } } return true; }  boolean evaluate(String input); boolean evaluate2(String input);  }
@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptNullStringsAsInput2() { uniqueChars.evaluate2(null); }
@Test public void shouldReturnTrueIfInputStringIsEmpty2() { assertTrue(uniqueChars.evaluate2("")); }
@Test public void shouldReturnFalseIfInputStringContainsDuplicatedChars2() { assertFalse(uniqueChars.evaluate2("vicente")); }
@Test public void shouldReturnTrueIfInputStringDoesNotContainDuplicatedChars2() { assertTrue(uniqueChars.evaluate2("pedro")); }