@Test public void testSwappingPrimarySecondaryDoesntImpactHashCode() { assertEquals(new DisjointPathPair<>(ABC, ADC).hashCode(), new DisjointPathPair<>(ADC, ABC).hashCode()); }
@Override public int hashCode() { return hasBackup() ? primary.hashCode() + secondary.hashCode() : Objects.hash(primary); }
DisjointPathPair implements Path<V, E> { @Override public int hashCode() { return hasBackup() ? primary.hashCode() + secondary.hashCode() : Objects.hash(primary); } }
DisjointPathPair implements Path<V, E> { @Override public int hashCode() { return hasBackup() ? primary.hashCode() + secondary.hashCode() : Objects.hash(primary); } DisjointPathPair(Path<V, E> primary, Path<V, E> secondary); }
DisjointPathPair implements Path<V, E> { @Override public int hashCode() { return hasBackup() ? primary.hashCode() + secondary.hashCode() : Objects.hash(primary); } DisjointPathPair(Path<V, E> primary, Path<V, E> secondary); @Override V src(); @Override V dst(); Path<V, E> primary(); Path<V, E> secondary(); @Override double cost(); @Override List<E> edges(); boolean hasBackup(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); int size(); }
DisjointPathPair implements Path<V, E> { @Override public int hashCode() { return hasBackup() ? primary.hashCode() + secondary.hashCode() : Objects.hash(primary); } DisjointPathPair(Path<V, E> primary, Path<V, E> secondary); @Override V src(); @Override V dst(); Path<V, E> primary(); Path<V, E> secondary(); @Override double cost(); @Override List<E> edges(); boolean hasBackup(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); int size();  }