### Question:
Point implements Serializable { public Point transform(ManhattanOrientation orientation) { switch (orientation) { case R0: return this; case R90: return new Point(-getY(), getX()); case R180: return new Point(-getX(), -getY()); case R270: return new Point(getY(), -getX()); case MY: return new Point(-getX(), getY()); case MYR90: return new Point(-getY(), -getX()); case MX: return new Point(getX(), -getY()); case MXR90: return new Point(getY(), getX()); default: throw new AssertionError(); } } Point(int x, int y); int getX(); Point withX(int xCoord); int getY(); Point withY(int yCoord); int[] toArray(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); Point add(Point other); Point scale(int scaleFactor); Point scale(int scaleFactorX, int scaleFactorY); Point mirror(); Point transform(ManhattanOrientation orientation);  }### Answer:
@Test public void testTransform() { System.out.println("transformPoints"); for (ManhattanOrientation mor : ManhattanOrientation.class.getEnumConstants()) { System.out.println("Test: " + mor.toString()); AffineTransform at = mor.affineTransform(); Point2D ax = new Point2D.Double(); Point2D ay = new Point2D.Double(); at.transform(new Point2D.Double(1, 0), ax); at.transform(new Point2D.Double(0, 1), ay); Point px = new Point(1, 0).transform(mor); Point py = new Point(0, 1).transform(mor); assertEquals(ax.getX(), px.getX(), 0.0); assertEquals(ax.getY(), px.getY(), 0.0); assertEquals(ay.getX(), py.getX(), 0.0); assertEquals(ay.getY(), py.getY(), 0.0); } }