@Test public void testEquals() { DependencyTraverser other1 = new DummyDependencyTraverser( true ); DependencyTraverser other2 = new DummyDependencyTraverser( false ); DependencyTraverser traverser1 = new AndDependencyTraverser( other1, other2 ); DependencyTraverser traverser2 = new AndDependencyTraverser( other2, other1 ); DependencyTraverser traverser3 = new AndDependencyTraverser( other1 ); assertEquals( traverser1, traverser1 ); assertEquals( traverser1, traverser2 ); assertNotEquals( traverser1, traverser3 ); assertNotEquals( traverser1, this ); assertNotEquals( traverser1, null ); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); }
AndDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); } }
AndDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); }
AndDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); } 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 { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } AndDependencyTraverser that = (AndDependencyTraverser) obj; return traversers.equals( that.traversers ); } 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();  }