@Test public void testHashCode() { DependencySelector other1 = new DummyDependencySelector( true ); DependencySelector other2 = new DummyDependencySelector( false ); DependencySelector selector1 = new AndDependencySelector( other1, other2 ); DependencySelector selector2 = new AndDependencySelector( other2, other1 ); assertEquals( selector1.hashCode(), selector2.hashCode() ); }
@Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; }
AndDependencySelector implements DependencySelector { @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; } }
AndDependencySelector implements DependencySelector { @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; } AndDependencySelector( DependencySelector... selectors );  AndDependencySelector( Collection<? extends DependencySelector> selectors ); private  AndDependencySelector( Set<DependencySelector> selectors ); }
AndDependencySelector implements DependencySelector { @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; } 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 { @Override public int hashCode() { if ( hashCode == 0 ) { int hash = 17; hash = hash * 31 + selectors.hashCode(); hashCode = hash; } return hashCode; } 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();  }