MmffAromaticTypeMapping { static String getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion) { if (anion && symb.startsWith("N")) symb = "N5M"; if (map.containsKey(symb)) symb = map.get(symb); if ((imidazolium || anion) && symb.charAt(symb.length() - 1) == suffix) symb = symb.substring(0, symb.length() - 1); return symb; } MmffAromaticTypeMapping();   }
@Test public void imidazoleCarbonTypesAreNeitherAlphaOrBeta() { Map<String, String> map = Collections.singletonMap("CB", "C5A"); assertThat(MmffAromaticTypeMapping.getAromaticType(map, 'A', "CB", true, false), is("C5")); }
@Test public void imidazoleNitrogenTypesAreNeitherAlphaOrBeta() { Map<String, String> map = Collections.singletonMap("N=C", "N5A"); assertThat(MmffAromaticTypeMapping.getAromaticType(map, 'A', "N=C", true, false), is("N5")); }
@Test public void anionCarbonTypesAreNeitherAlphaOrBeta() { Map<String, String> map = Collections.singletonMap("CB", "C5A"); assertThat(MmffAromaticTypeMapping.getAromaticType(map, 'A', "CB", false, true), is("C5")); }
@Test public void anionNitrogensAreAlwaysN5M() { Map<String, String> map = Collections.singletonMap("N=C", "N5A"); assertThat(MmffAromaticTypeMapping.getAromaticType(map, 'A', "N=C", false, true), is("N5M")); }
@Test public void useMappingWhenNeitherFlagIsRaised() { Map<String, String> map = Collections.singletonMap("N=C", "N5A"); assertThat(MmffAromaticTypeMapping.getAromaticType(map, 'A', "N=C", false, false), is("N5A")); }