@Test public void testNewInstance() { assertNull( AndDependencyTraverser.newInstance( null, null ) ); DependencyTraverser traverser = new DummyDependencyTraverser(); assertSame( traverser, AndDependencyTraverser.newInstance( traverser, null ) ); assertSame( traverser, AndDependencyTraverser.newInstance( null, traverser ) ); assertSame( traverser, AndDependencyTraverser.newInstance( traverser, traverser ) ); assertNotNull( AndDependencyTraverser.newInstance( traverser, new DummyDependencyTraverser() ) ); }
public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); }
AndDependencyTraverser implements DependencyTraverser { public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); } }
AndDependencyTraverser implements DependencyTraverser { public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); }
AndDependencyTraverser implements DependencyTraverser { public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode(); }
AndDependencyTraverser implements DependencyTraverser { public static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ) { if ( traverser1 == null ) { return traverser2; } else if ( traverser2 == null || traverser2.equals( traverser1 ) ) { return traverser1; } return new AndDependencyTraverser( traverser1, traverser2 ); } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode();  }