StandardAtomGenerator { static String chargeAdjunctText(final int charge, final int unpaired) { StringBuilder sb = new StringBuilder(); if (unpaired == 1) { if (charge != 0) { sb.append('(').append(BULLET).append(')'); } else { sb.append(BULLET); } } else if (unpaired > 1) { if (charge != 0) { sb.append('(').append(unpaired).append(BULLET).append(')'); } else { sb.append(unpaired).append(BULLET); } } final char sign = charge < 0 ? MINUS : PLUS; final int coefficient = Math.abs(charge); if (coefficient > 1) sb.append(coefficient); if (coefficient > 0) sb.append(sign); return sb.toString(); } StandardAtomGenerator(Font font); private  StandardAtomGenerator(Font font, double adjunctSpacing, double scriptSize);   }
@Test public void anion() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(-1, 0), is("−")); }
@Test public void cation() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(1, 0), is("+")); }
@Test public void dianion() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(-2, 0), is("2−")); }
@Test public void dication() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(2, 0), is("2+")); }
@Test public void radical() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(0, 1), is("•")); }
@Test public void diradical() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(0, 2), is("2•")); }
@Test public void diradicalCation() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(1, 2), is("(2•)+")); }
@Test public void radicalAndAnion() throws Exception { assertThat(StandardAtomGenerator.chargeAdjunctText(-1, 1), is("(•)−")); }