private LinkedList < T > computeRecursiveTraversal ( T node , NodePath < T > nodePath ) { try { LinkedList < T > imports = new LinkedList <> ( ) ; Set < T > alreadyIncludedImports = new HashSet <> ( ) ; for ( T neighbor : this . traversalFunction . apply ( node ) ) { nodePath . appendNode ( neighbor ) ; addSubtraversal ( neighbor , imports , alreadyIncludedImports , nodePath ) ; nodePath . popTail ( ) ; } return imports ; } catch ( ExecutionException ee ) { throw new RuntimeException ( ee ) ; } }
Actually compute the traversal if it is not in the cache .