SMARTSQueryTool { public void setAromaticity(Aromaticity aromaticity) { this.aromaticity = checkNotNull(aromaticity, "aromaticity was not provided"); } SMARTSQueryTool(String smarts, IChemObjectBuilder builder); void setQueryCacheSize(int maxEntries); void useSmallestSetOfSmallestRings(); void useRelevantRings(); void useEssentialRings(); void setAromaticity(Aromaticity aromaticity); String getSmarts(); void setSmarts(String smarts); boolean matches(IAtomContainer atomContainer); boolean matches(IAtomContainer atomContainer, boolean forceInitialization); int countMatches(); List<List<Integer>> getMatchingAtoms(); List<List<Integer>> getUniqueMatchingAtoms();  }
@Test(expected = NullPointerException.class) public void nullAromaticity() { SMARTSQueryTool sqt = new SMARTSQueryTool("CC", DefaultChemObjectBuilder.getInstance()); sqt.setAromaticity(null); }
@Test public void setAromaticity() throws Exception { SMARTSQueryTool sqt = new SMARTSQueryTool("[a]", DefaultChemObjectBuilder.getInstance()); IAtomContainer furan = smiles("O1C=CC=C1"); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(furan); sqt.setAromaticity(new Aromaticity(ElectronDonation.cdk(), Cycles.mcb())); assertTrue(sqt.matches(furan, true)); sqt.setAromaticity(new Aromaticity(ElectronDonation.piBonds(), Cycles.mcb())); assertFalse(sqt.matches(furan, true)); }