### Question:
PropertyDefinition extends ItemDefinition implements javax.jcr.nodetype.PropertyDefinition { @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof PropertyDefinition) { PropertyDefinition that = (PropertyDefinition)obj; return this.id.equals(that.id); } return false; } PropertyDefinition( String declaringNodeTypeName,
                               String name,
                               int requiredType,
                               boolean isAutoCreated,
                               boolean isMandatory,
                               boolean isProtected,
                               boolean isFullTextSearchable,
                               boolean isMultiple,
                               boolean isQueryOrderable,
                               int onParentVersion,
                               List<String> defaultValues,
                               List<String> valueConstraints,
                               List<String> availableQueryOperations,
                               Map<String, NodeType> nodeTypes ); static Calendar parseDate( String dateString ); @Override String getName(); @Override String[] getAvailableQueryOperators(); @Override Value[] getDefaultValues(); @Override int getRequiredType(); @Override String[] getValueConstraints(); @Override boolean isFullTextSearchable(); @Override boolean isMultiple(); @Override boolean isQueryOrderable(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }### Answer:
@Test public void shouldConsiderEqualIfSameNameAndRequiredTypeAndMultiplicity() { defn = createPropertyDefinition(); defn2 = createPropertyDefinition(); assertThat(defn.equals(defn2), is(true)); }
@Test public void shouldConsiderNotEqualIfDifferentName() { defn = createPropertyDefinition(); name = "other:name"; defn2 = createPropertyDefinition(); assertThat(defn.equals(defn2), is(false)); }
@Test public void shouldConsiderNotEqualIfDifferentRequiredType() { defn = createPropertyDefinition(); requiredType = requiredType == PropertyType.PATH ? PropertyType.BOOLEAN : PropertyType.PATH; defn2 = createPropertyDefinition(); assertThat(defn.equals(defn2), is(false)); }
@Test public void shouldConsiderNotEqualIfDifferentMultiplicity() { defn = createPropertyDefinition(); isMultiple = !isMultiple; defn2 = createPropertyDefinition(); assertThat(defn.equals(defn2), is(false)); }