RequestField implements RequestObject { public static RequestField of(String fieldName) { return new RequestField(fieldName); } private  RequestField(String fieldName); static RequestField of(String fieldName); String getFieldName(); @Override RequestObjectType getType(); @Override String toString(); @Override final boolean equals(Object o); @Override final int hashCode();  }
@Test public void testTwoDifferentObjectsEqualsWhenSameNameGiven() throws Exception { RequestField requestField = RequestField.of("foo"); assertThat(requestField).isEqualTo(RequestField.of("foo")); }
@Test public void testTwoObjectsAreNotEqualWhenDifferentNames() throws Exception { RequestField requestField = RequestField.of("foo"); assertThat(requestField).isNotEqualTo(RequestField.of("bar")); }