MoleculeSignature extends AbstractGraphSignature { @Override protected int getVertexCount() { return this.molecule.getAtomCount(); } MoleculeSignature(IAtomContainer molecule);  MoleculeSignature(IAtomContainer molecule, int height); @Override /** {@inheritDoc} */ String signatureStringForVertex(int vertexIndex); @Override /** {@inheritDoc} */ String signatureStringForVertex(int vertexIndex, int height); @Override /** {@inheritDoc} */ AbstractVertexSignature signatureForVertex(int vertexIndex); List<Orbit> calculateOrbits(); static IAtomContainer fromSignatureString(String signatureString, IChemObjectBuilder coBuilder); String toCanonicalSignatureString(int height);  }
@Test public void getVertexCountTest() { Assert.assertEquals(mol.getAtomCount(), molSig.getVertexCount()); }
@Test public void napthaleneWithDoubleBondsAndHydrogenHeightTest() { IAtomContainer napthalene = builder.newInstance(IAtomContainer.class); for (int i = 0; i < 10; i++) { napthalene.addAtom(builder.newInstance(IAtom.class, "C")); } napthalene.addBond(0, 1, IBond.Order.SINGLE); napthalene.addBond(0, 5, IBond.Order.DOUBLE); napthalene.addBond(1, 2, IBond.Order.DOUBLE); napthalene.addBond(1, 6, IBond.Order.SINGLE); napthalene.addBond(2, 3, IBond.Order.SINGLE); napthalene.addBond(2, 9, IBond.Order.SINGLE); napthalene.addBond(3, 4, IBond.Order.DOUBLE); napthalene.addBond(4, 5, IBond.Order.SINGLE); napthalene.addBond(6, 7, IBond.Order.DOUBLE); napthalene.addBond(7, 8, IBond.Order.SINGLE); napthalene.addBond(8, 9, IBond.Order.DOUBLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(0, 10, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(3, 11, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(4, 12, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(5, 13, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(6, 14, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(7, 15, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(8, 16, IBond.Order.SINGLE); napthalene.addAtom(builder.newInstance(IAtom.class, "H")); napthalene.addBond(9, 17, IBond.Order.SINGLE); int height = 2; SignatureQuotientGraph mqg = new SignatureQuotientGraph(napthalene, height); Assert.assertEquals(4, mqg.getVertexCount()); Assert.assertEquals(6, mqg.getEdgeCount()); Assert.assertEquals(2, mqg.numberOfLoopEdges()); }