InheritanceFilter implements GeneFilter { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InheritanceFilter that = (InheritanceFilter) o; return Objects.equals(compatibleModes, that.compatibleModes); } InheritanceFilter(ModeOfInheritance compatibleMode);  InheritanceFilter(ModeOfInheritance... compatibleModes);  InheritanceFilter(Set<ModeOfInheritance> compatibleModes); Set<ModeOfInheritance> getCompatibleModes(); @Override FilterResult runFilter(Gene gene); @Override FilterType getFilterType(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Set<ModeOfInheritance> JUST_ANY; }
@Test public void testEquals() { InheritanceFilter dominantFilter = new InheritanceFilter(ModeOfInheritance.AUTOSOMAL_DOMINANT); InheritanceFilter otherDominantFilter = new InheritanceFilter(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT)); assertThat(dominantFilter.equals(otherDominantFilter), is(true)); }
@Test public void testNotEquals() { InheritanceFilter recessiveFilter = new InheritanceFilter(EnumSet.of(ModeOfInheritance.AUTOSOMAL_RECESSIVE)); InheritanceFilter dominantFilter = new InheritanceFilter(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT)); assertThat(recessiveFilter.equals(dominantFilter), is(false)); }
@Test public void testNotEqualOtherObject() { InheritanceFilter instance = new InheritanceFilter(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT)); String string = "string"; assertThat(instance.equals(string), is(false)); assertThat(string.equals(instance), is(false)); }
@Test public void testNotEqualNull() { InheritanceFilter instance = new InheritanceFilter(EnumSet.of(ModeOfInheritance.AUTOSOMAL_RECESSIVE)); assertThat(instance.equals(null), is(false)); }