@Test public void testEquals() { DependencyTraverser traverser1 = new StaticDependencyTraverser( true ); DependencyTraverser traverser2 = new StaticDependencyTraverser( true ); DependencyTraverser traverser3 = new StaticDependencyTraverser( false ); 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; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; }
StaticDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; } }
StaticDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; } StaticDependencyTraverser( boolean traverse ); }
StaticDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; } StaticDependencyTraverser( boolean traverse ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode(); }
StaticDependencyTraverser implements DependencyTraverser { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } else if ( null == obj || !getClass().equals( obj.getClass() ) ) { return false; } StaticDependencyTraverser that = (StaticDependencyTraverser) obj; return traverse == that.traverse; } StaticDependencyTraverser( boolean traverse ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode();  }