ParameterDependencyGraph { public boolean doesDependencyExist( String parameterName ) { return dependencyGraph .values() .stream() .flatMap( Set::stream ) .anyMatch( s -> s.equals( parameterName ) ); } ParameterDependencyGraph( final MasterReport report,
                                   final Map<String, ParameterDefinitionEntry> reportParameter,
                                   final ParameterContext parameterContext,
                                   final Map<String, Object> computedParameterValues );   ParameterDependencyGraph( String... allParameterNames ); LinkedHashMap<String, Set<String>> getDependencyGraph(); void setDependencyGraph( LinkedHashMap<String, Set<String>> arg ); Set<String> getAllParameterNames(); void setAllParameterNames( Set<String> allParameterNames ); Set<String> getDependentParameterFor( String parameterName ); Set<String> getAllDependencies( String... parameterNames ); Set<String> getAllDependencies( Iterable<String> parameterNames ); Set<String> getKnownParameter(); boolean doesDependencyExist( String parameterName ); boolean areAllParametersProcessed();  }
@Test public void testDoesDependencyExist() { final ParameterDependencyGraph dependencyGraph = new ParameterDependencyGraph( "param1", "param2", "param3" ); assertFalse( dependencyGraph.doesDependencyExist( "param2" ) ); dependencyGraph.addDependency( "param1", "param2" ); assertTrue( dependencyGraph.doesDependencyExist( "param2" ) ); }