### Question:
FieldMapping implements IFieldMapping { @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } FieldMapping that = (FieldMapping) o; if ( sourceFieldName != null ? !sourceFieldName.equals( that.sourceFieldName ) : that.sourceFieldName != null ) { return false; } if ( targetFieldName != null ? !targetFieldName.equals( that.targetFieldName ) : that.targetFieldName != null ) { return false; } return true; } FieldMapping();  FieldMapping( String sourceFieldName, String targetFieldName ); @Override String getSourceFieldName(); @Override String getTargetFieldName(); void setSourceFieldName( String sourceFieldName ); void setTargetFieldName( String targetFieldName ); @Override boolean equals( Object o ); @Override int hashCode();  }### Answer:
@Test public void testEquals() throws Exception { mapping = new FieldMapping( "from", "to" ); assertTrue( mapping.equals( mapping ) ); assertFalse( mapping.equals( "string" ) ); FieldMapping anotherMapping = new FieldMapping( "source", "destination" ); assertFalse( mapping.equals( anotherMapping ) ); anotherMapping = new FieldMapping( "from", "destination" ); assertFalse( mapping.equals( anotherMapping ) ); anotherMapping = new FieldMapping( "source", "to" ); assertFalse( mapping.equals( anotherMapping ) ); FieldMapping equivMapping = new FieldMapping( "from", "to" ); assertTrue( mapping.equals( equivMapping ) ); }