Import implements Serializable { @Override public boolean equals( Object obj ) { return obj instanceof Import && Objects.equals( this.instancePath, ((Import) obj).instancePath ); } Import( Instance instance );  Import( String instancePath, String componentName );  Import( String instancePath, String componentName, Map<String,String> exportedVars ); Map<String,String> getExportedVars(); String getInstancePath(); String getComponentName(); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { Import imp = new Import( "inst", "comp" ); Assert.assertFalse( imp.equals( null )); Assert.assertFalse( imp.equals( new Import( "inst2", "comp" ))); Assert.assertEquals( imp, imp ); Assert.assertEquals( imp, new Import( "inst", "comp" )); }