RestrictionDefinitionImpl implements RestrictionDefinition { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RestrictionDefinitionImpl) { RestrictionDefinitionImpl other = (RestrictionDefinitionImpl) o; return type == other.type && isMandatory == other.isMandatory && name.equals(other.name); } return false; } RestrictionDefinitionImpl(@NotNull String name, Type<?> type, boolean isMandatory); @NotNull @Override String getName(); @NotNull @Override Type<?> getRequiredType(); @Override boolean isMandatory(); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void testEquals() { assertEquals(definition, new RestrictionDefinitionImpl(name, Type.NAME, true)); }