Map < Archive , Set < Archive > > dependences ( ) { Map < Archive , Set < Archive > > map = new HashMap <> ( ) ; parsedArchives . values ( ) . stream ( ) . flatMap ( Deque :: stream ) . filter ( a -> ! a . isEmpty ( ) ) . forEach ( source -> { Set < Archive > deps = getDependences ( source ) . collect ( toSet ( ) ) ; if ( ! deps . isEmpty ( ) ) { map . put ( source , deps ) ; } } ) ; return map ; }
Returns a map from an archive to its required archives