@Test public void testEquals() { Object obj1 = new Object(); Object obj2 = new Object(); ModelError def1 = new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj1 ); ModelError def2 = new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj1, value( "v" )); ModelError def3 = new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj2 ); RoboconfError def4 = new RoboconfError( ErrorCode.CMD_CONFLICTING_INSTANCE_NAME, value( "v" )); Assert.assertTrue( def1.equals( def1 )); Assert.assertTrue( def1.equals( new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj1 ))); Assert.assertFalse( def1.equals( null )); Assert.assertFalse( def1.equals( new Object())); Assert.assertFalse( def1.equals( def2 )); Assert.assertFalse( def1.equals( def3 )); Assert.assertFalse( def1.equals( def4 )); Assert.assertTrue( def2.equals( def2 )); Assert.assertTrue( def2.equals( new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj1, value( "v" )))); Assert.assertFalse( def2.equals( def1 )); Assert.assertFalse( def2.equals( def3 )); Assert.assertFalse( def2.equals( def4 )); Assert.assertTrue( def3.equals( def3 )); Assert.assertTrue( def3.equals( new ModelError( ErrorCode.CMD_CANNOT_HAVE_ANY_PARENT, obj2 ))); Assert.assertFalse( def3.equals( def1 )); Assert.assertFalse( def3.equals( def2 )); Assert.assertFalse( def2.equals( def4 )); Assert.assertTrue( def4.equals( def4 )); Assert.assertTrue( def4.equals( new RoboconfError( ErrorCode.CMD_CONFLICTING_INSTANCE_NAME, value( "v" )))); Assert.assertFalse( def4.equals( def1 )); Assert.assertFalse( def4.equals( def2 )); Assert.assertFalse( def4.equals( def3 )); }
@Override public boolean equals( Object obj ) { return super.equals( obj ) && Objects.equals( this.modelObject, ((ModelError) obj).modelObject ); }
ModelError extends RoboconfError { @Override public boolean equals( Object obj ) { return super.equals( obj ) && Objects.equals( this.modelObject, ((ModelError) obj).modelObject ); } }
ModelError extends RoboconfError { @Override public boolean equals( Object obj ) { return super.equals( obj ) && Objects.equals( this.modelObject, ((ModelError) obj).modelObject ); } ModelError( ErrorCode errorCode, Object modelObject );  ModelError( ErrorCode errorCode, Object modelObject, ErrorDetails... details ); }
ModelError extends RoboconfError { @Override public boolean equals( Object obj ) { return super.equals( obj ) && Objects.equals( this.modelObject, ((ModelError) obj).modelObject ); } ModelError( ErrorCode errorCode, Object modelObject );  ModelError( ErrorCode errorCode, Object modelObject, ErrorDetails... details ); Object getModelObject(); @Override boolean equals( Object obj ); @Override int hashCode(); }
ModelError extends RoboconfError { @Override public boolean equals( Object obj ) { return super.equals( obj ) && Objects.equals( this.modelObject, ((ModelError) obj).modelObject ); } ModelError( ErrorCode errorCode, Object modelObject );  ModelError( ErrorCode errorCode, Object modelObject, ErrorDetails... details ); Object getModelObject(); @Override boolean equals( Object obj ); @Override int hashCode();  }