AtomSymbol { AtomSymbol translate(double x, double y) { return transform(AffineTransform.getTranslateInstance(x, y)); } AtomSymbol(TextOutline element, List<TextOutline> adjuncts); private  AtomSymbol(TextOutline element, List<TextOutline> adjuncts, List<TextOutline> annotationAdjuncts,
            SymbolAlignment alignment, ConvexHull hull);   }
@Test public void testTranslate() throws Exception { TextOutline outline = new TextOutline("Cl", font); AtomSymbol symbol = new AtomSymbol(outline, Collections.<TextOutline> emptyList()); AtomSymbol transformed = symbol.translate(4, 2); Rectangle2D orgBounds = symbol.getOutlines().get(0).getBounds2D(); Rectangle2D newBounds = transformed.getOutlines().get(0).getBounds2D(); assertThat(newBounds.getX(), closeTo(orgBounds.getX() + 4, 0.01)); assertThat(newBounds.getY(), closeTo(orgBounds.getY() + 2, 0.01)); assertThat(newBounds.getMaxX(), closeTo(orgBounds.getMaxX() + 4, 0.01)); assertThat(newBounds.getMaxY(), closeTo(orgBounds.getMaxY() + 2, 0.01)); }