AtomSymbol { AtomSymbol center(double x, double y) { Point2D center = getAlignmentCenter(); return translate(x - center.getX(), y - center.getY()); } AtomSymbol(TextOutline element, List<TextOutline> adjuncts); private  AtomSymbol(TextOutline element, List<TextOutline> adjuncts, List<TextOutline> annotationAdjuncts,
            SymbolAlignment alignment, ConvexHull hull);   }
@Test public void testCenter() throws Exception { TextOutline outline = new TextOutline("Cl", font); AtomSymbol symbol = new AtomSymbol(outline, Collections.<TextOutline> emptyList()); AtomSymbol transformed = symbol.center(2, 2); Rectangle2D oBounds = outline.getBounds(); Rectangle2D newBounds = transformed.getOutlines().get(0).getBounds2D(); double dx = 2 - oBounds.getCenterX(); double dy = 2 - oBounds.getCenterY(); assertThat(newBounds.getX(), closeTo(oBounds.getMinX() + dx, 0.01)); assertThat(newBounds.getY(), closeTo(oBounds.getMinY() + dy, 0.01)); assertThat(newBounds.getMaxX(), closeTo(oBounds.getMaxX() + dx, 0.01)); assertThat(newBounds.getMaxY(), closeTo(oBounds.getMaxY() + dy, 0.01)); }