@Test public void shouldReturnTrueIfInputStringContainsDuplicatedChars() { assertFalse(uniqueChars.evaluate("vicente")); }
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; }
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; } }
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; }  }
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); }
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);  }