this method should be called before beginning any equals methods . in order to return true the method : the two given objects are the same instance using == . this also means if both objects are null then this method will return true well technically they are equal tests that neither object is null the the two classes from the objects are equal using == the boilerplate using this method then becomes : boolean equals = false ; if equalshelper.classequal this , obj targetclass casted = targetclass obj ; equals = equalshelper.equal this.getid , casted.getid & & equalshelper . equal this.getname , casted.getname ; return equals ; concode_field_sep PlaceHolder placeHolder concode_field_sep boolean equal concode_elem_sep boolean equal concode_elem_sep boolean equal concode_elem_sep boolean equal
boolean function ( Object arg0 , Object arg1 ) { return arg0 == arg1 || ! ( arg0 == null || arg1 == null ) && arg0 . getClass ( ) == arg1 . getClass ( ) ; }