AbstractAWTDrawVisitor implements IDrawVisitor { public int[] transformPoint(double xCoord, double yCoord) { double[] src = new double[]{xCoord, yCoord}; double[] dest = new double[2]; this.transform.transform(src, 0, dest, 0, 1); return new int[]{(int) dest[0], (int) dest[1]}; }  int[] transformPoint(double xCoord, double yCoord); void transformPoint(double[] xy); @Override void setTransform(AffineTransform transform);  }
@Test public void testTransformPoint() { AbstractAWTDrawVisitor visitor = new NestedAWTDrawVisitor(); visitor.setTransform(new AffineTransform()); int[] transformed = visitor.transformPoint(1, 2); Assert.assertEquals(1, transformed[0]); Assert.assertEquals(2, transformed[1]); }