Point implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof Point) { Point p = (Point)obj; return x == p.x && y == p.y; } return false; } Point();  Point(int x, int y);  Point(double x, double y);  Point(Point p); @Override boolean equals(Object obj); @Override String toString(); double getX(); double getY(); Point getLocation(); void setLocation(Point p); void setLocation(int x, int y); void setLocation(double x, double y); void move(double x, double y); void translate(double dx, double dy); @Override int hashCode(); static double distanceSq(double x1, double y1, double x2, double y2); double distanceSq(double px, double py); double distanceSq(Point p); static double distance(double x1, double y1, double x2, double y2); double distance(double px, double py); double distance(Point p); @SuppressWarnings("CloneDoesntCallSuperClone") @Override Object clone(); public double x; public double y; }
@Test public void notEqualsToNullTest() { Point first = new Point(1.23, 1.1); Assert.assertFalse(first.equals(null)); }