TrieEntry implements Entry<String, T> { @Override public @Nullable T setValue(T value) { var replaced = this.value; this.value = value; return replaced; } TrieEntry(char character, @Nullable TrieEntry<T> parent);   TrieEntry(char character, @Nullable TrieEntry<T> parent, String key, T value); @Override @Nullable String getKey(); @Override @Nullable T getValue(); @Override @Nullable T setValue(T value); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }
@Test void setValue() { entry.value = "old"; assertEquals("old", entry.setValue("new")); assertEquals("new", entry.value); }