### Question:
ObjectProperty implements Serializable { @Override public int hashCode() { return hashCode; } ObjectProperty(Object object, @CheckForNull String property, int index);  ObjectProperty(Object object, String property);  ObjectProperty(Object object); Object getObject(); @CheckForNull String getProperty(); int getIndex(); boolean hasIndex(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testHashCode() { ObjectProperty objectProperty = new ObjectProperty("foo"); assertThat(objectProperty.hashCode(), is(objectProperty.hashCode())); assertThat(new ObjectProperty("foo").hashCode(), is(new ObjectProperty("foo").hashCode())); assertThat(new ObjectProperty("foo", "bar").hashCode(), is(new ObjectProperty("foo", "bar").hashCode())); assertThat(new ObjectProperty("foo", "bar", 1).hashCode(), is(new ObjectProperty("foo", "bar", 1).hashCode())); }
@Test public void testHashCode_IsCached() { HashCodeCounter hashCodeCounter = new HashCodeCounter(); ObjectProperty objectProperty = new ObjectProperty(hashCodeCounter); assertThat(objectProperty.hashCode(), is(objectProperty.hashCode())); assertThat(hashCodeCounter.count, is(1)); }