### Question:
AutoCompleter { public Optional<String> autocomplete(String prefix) { if (Strings.isNullOrEmpty(prefix)) { return Optional.empty(); } int potentialMatchIdx = findIndexOfLexicographicallyPreceeding(0, dictionary.size(), prefix); if (potentialMatchIdx < dictionary.size()) { String potentialMatch = dictionary.get(potentialMatchIdx); return potentialMatch.startsWith(prefix) ? Optional.of(potentialMatch) : Optional.empty(); } else { return Optional.empty(); } } AutoCompleter(Collection<String> dictionary); Optional<String> autocomplete(String prefix);  }### Answer:
@Test @DisplayName("no match in []") public void testNoMatchInEmptyDict() { AutoCompleter autoCompleter = new AutoCompleter(Set.of()); Optional<String> result = autoCompleter.autocomplete("tea"); Assertions.assertFalse(result.isPresent()); }
@Test @DisplayName("no match for \"\"") public void testNoMatchForEmptyString() { AutoCompleter autoCompleter = new AutoCompleter(Set.of("asd")); Optional<String> result = autoCompleter.autocomplete(""); Assertions.assertFalse(result.isPresent()); }