public static boolean equals(Object o1,Object o2){
  if (o1 == null) {
    return o2 == null;
  }
  return o1.equals(o2);
}

public static boolean equals ( Object o1 , Object o2 ) { if ( o1 == null ) { return o2 == null ; } return o1 . equals ( o2 ) ; }
tests whether two objects are equal handling cases where one or both may be null
