### Question:
Trie implements Serializable { public String getCommonPrefix() { StringBuffer buffer = new StringBuffer(); if( children.size() != 1 ) return buffer.toString(); buildPrefix( buffer, this ); return buffer.toString(); } Trie();   Trie( char key ); void put( String key, V value ); V get( String key ); boolean hasPrefix( String key ); String getCommonPrefix(); @Override String toString();  }### Answer:
@Test public void testGetCommonPrefix() { Trie<String> trie = new Trie<>(); trie.put( "a", "a" ); trie.put( "aa", "aa" ); trie.put( "aaa", "aaa" ); trie.put( "aabb", "aabb" ); trie.put( "aaabb", "aaabb" ); trie.put( "aacbb", "aacbb" ); assertEquals( "aa", trie.getCommonPrefix() ); }