public Map < Character , TrieNode > getGodChildren ( ) { String postContext = this . getString ( ) . substring ( 1 ) ; return trie . tokens ( ) . stream ( ) . collect ( Collectors . toMap ( x -> x , token -> { TrieNode traverse = trie . traverse ( token + postContext ) ; return traverse . getString ( ) . equals ( token + postContext ) ? traverse : null ; } ) ) . entrySet ( ) . stream ( ) . filter ( e -> null != e . getValue ( ) ) . collect ( Collectors . toMap ( e -> e . getKey ( ) , e -> e . getValue ( ) ) ) ; }
Gets god children .