### Question:
Point { public Point rotate(double radians) { double cos = Math.cos(radians), sin = Math.sin(radians); Point temp = this.clone(); setX(temp.y * sin + temp.x * cos); setY(temp.y * cos - temp.x * sin); return this; } Point(double x, double y); static Point cis(double ang, double len); Point clone(); double[] get(); void set(double x, double y); Point translate(double x, double y); static Point add(Point first, Point other); Point negate(); Point scale(double scale); Point rotate(double radians); Point translate(Point p); double getY(); void setY(double y); double getX(); void setX(double x); static Point subtract(Point subtractee, Point subtractor); static double dotProduct(Point a, Point b); static double normSquared(Point point); static double norm(Point point); double norm(); static double distSqared(Point a, Point b); static double dist(Point a, Point b); static boolean isFuzzyEqual(double first, double second, double epsilon); static boolean isFuzzyEqual(double first, double second); static boolean fuzzyEquals(Point fir, Point sec, double epsilon); Point weightedAvg(Point b, double bWeight); Point avg(Point b); static Point bezierSample(double locInCurve, Point... corners); static Point recursiveBezierSample(double locInCurve, Point... corners); @Override String toString(); @Override boolean equals(Object o); Point localizerToMathCoords(); Point mathToWeaverCoords(); Point weaverToLocalizerCoords(); Point changeCoords(CoordinateSystems src, CoordinateSystems dest); @Deprecated Point mathToFrcCoords(); double[] toPolarCoords(); @Override int hashCode(); static final Point ORIGIN; }### Answer:
@Test void rotateTest() { double fuzz = 1E-8; Point p1 = new Point(1, 1); p1.rotate(Math.PI); assertTrue(Point.fuzzyEquals(p1, new Point(-1, -1), fuzz)); p1 = new Point(-1, 0); p1.rotate(Math.PI / 2); assertTrue(Point.fuzzyEquals(p1, new Point(0, 1), fuzz)); p1 = Point.cis(Math.PI / 8, 7); p1.rotate(Math.PI / 4); assertTrue(Point.fuzzyEquals(p1, Point.cis(3*Math.PI / 8, 7), fuzz)); for (int i = 0; i < 100; i++){ double ang = Math.random() * 100 * Math.PI; double len = Math.random() * 50; p1 = Point.cis(ang, len); double rot = Math.random() * 100 - 50; p1.rotate(rot); assertTrue(Point.fuzzyEquals(p1, Point.cis(ang + rot, len), fuzz)); } }