RestrictionImpl implements Restriction { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RestrictionImpl) { RestrictionImpl other = (RestrictionImpl) o; return definition.equals(other.definition) && property.equals(other.property); } return false; } RestrictionImpl(@NotNull PropertyState property, @NotNull RestrictionDefinition def);  RestrictionImpl(@NotNull PropertyState property, boolean isMandatory); @NotNull @Override RestrictionDefinition getDefinition(); @NotNull @Override PropertyState getProperty(); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void testEquals() { assertEquals(restriction, new RestrictionImpl(createProperty(name, value, type), isMandatory)); }