MmffAromaticTypeMapping { @SuppressWarnings("PMD.CyclomaticComplexity") static int contribution(int elem, int x, int v) { switch (elem) { case 6: if (x == 3 && v == 4) return 1; break; case 7: if (x == 2 && v == 3) return 1; if (x == 3 && v == 4) return 1; if (x == 3 && v == 3) return 2; if (x == 2 && v == 2) return 2; break; case 8: case 16: if (x == 2 && v == 2) return 2; break; } return -1; } MmffAromaticTypeMapping();   }
@Test public void tetravalentCarbonContributesOneElectron() { assertThat(MmffAromaticTypeMapping.contribution(6, 3, 4), is(1)); }
@Test public void tetravalentTricoordinateNitrogenContributesOneElectron() { assertThat(MmffAromaticTypeMapping.contribution(7, 3, 4), is(1)); }
@Test public void trivalentBicoordinateNitrogenContributesOneElectron() { assertThat(MmffAromaticTypeMapping.contribution(7, 2, 3), is(1)); }
@Test public void trivalentTricoordinateNitrogenContributesTwoElectrons() { assertThat(MmffAromaticTypeMapping.contribution(7, 3, 3), is(2)); }
@Test public void bivalentBicoordinateNitrogenContributesTwoElectrons() { assertThat(MmffAromaticTypeMapping.contribution(7, 2, 2), is(2)); }
@Test public void divalentSulphurContributesTwoElectrons() { assertThat(MmffAromaticTypeMapping.contribution(16, 2, 2), is(2)); }
@Test public void divalentOxygenContributesTwoElectrons() { assertThat(MmffAromaticTypeMapping.contribution(8, 2, 2), is(2)); }
@Test public void contributionOfThreeValentCarbon() { assertThat(MmffAromaticTypeMapping.contribution(6, 3, 3), is(-1)); }
@Test public void contributionOfFiveValentNitrogen() { assertThat(MmffAromaticTypeMapping.contribution(7, 3, 5), is(-1)); }