@Test public void testTraverseDependency() { Dependency dependency = new Dependency( new DefaultArtifact( "g:a:v:1" ), "runtime" ); DependencySelector selector = new AndDependencySelector(); assertTrue( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( false ), new DummyDependencySelector( false ) ); assertFalse( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( true ), new DummyDependencySelector( false ) ); assertFalse( selector.selectDependency( dependency ) ); selector = new AndDependencySelector( new DummyDependencySelector( true ), new DummyDependencySelector( true ) ); assertTrue( selector.selectDependency( dependency ) ); }
public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; }
AndDependencySelector implements DependencySelector { public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; } }
AndDependencySelector implements DependencySelector { public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; } AndDependencySelector( DependencySelector... selectors );  AndDependencySelector( Collection<? extends DependencySelector> selectors ); private  AndDependencySelector( Set<DependencySelector> selectors ); }
AndDependencySelector implements DependencySelector { public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; } AndDependencySelector( DependencySelector... selectors );  AndDependencySelector( Collection<? extends DependencySelector> selectors ); private  AndDependencySelector( Set<DependencySelector> selectors ); static DependencySelector newInstance( DependencySelector selector1, DependencySelector selector2 ); boolean selectDependency( Dependency dependency ); DependencySelector deriveChildSelector( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode(); }
AndDependencySelector implements DependencySelector { public boolean selectDependency( Dependency dependency ) { for ( DependencySelector selector : selectors ) { if ( !selector.selectDependency( dependency ) ) { return false; } } return true; } AndDependencySelector( DependencySelector... selectors );  AndDependencySelector( Collection<? extends DependencySelector> selectors ); private  AndDependencySelector( Set<DependencySelector> selectors ); static DependencySelector newInstance( DependencySelector selector1, DependencySelector selector2 ); boolean selectDependency( Dependency dependency ); DependencySelector deriveChildSelector( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode();  }