StandardAtomGenerator { TextOutline positionMassLabel(TextOutline massLabel, TextOutline elementLabel) { final Rectangle2D elementBounds = elementLabel.getBounds(); final Rectangle2D massBounds = massLabel.getBounds(); return massLabel.translate((elementBounds.getMinX() - padding) - massBounds.getMaxX(), (elementBounds.getMinY() - (massBounds.getHeight() / 2)) - massBounds.getMinY()); } StandardAtomGenerator(Font font); private  StandardAtomGenerator(Font font, double adjunctSpacing, double scriptSize);   }
@Test public void positionMassLabel() { TextOutline mass = new TextOutline("15", font); TextOutline positioned = atomGenerator.positionMassLabel(mass, element); Rectangle2D elementBounds = element.getBounds(); Rectangle2D massBounds = positioned.getBounds(); assertThat(massBounds.getMaxX(), lessThan(elementBounds.getMinX())); assertThat(massBounds.getCenterY(), closeTo(elementBounds.getMinY(), 0.01)); }