AtomRefinable implements Refinable { @Override public int getConnectivity(int vertexI, int vertexJ) { int indexInRow; int maxRowIndex = connectionTable[vertexI].length; for (indexInRow = 0; indexInRow < maxRowIndex; indexInRow++) { if (connectionTable[vertexI][indexInRow] == vertexJ) { break; } } if (ignoreBondOrders) { if (indexInRow < maxRowIndex) { return 1; } else { return 0; } } else { if (indexInRow < maxRowIndex) { return bondOrders[vertexI][indexInRow]; } else { return 0; } } } AtomRefinable(IAtomContainer atomContainer);  AtomRefinable(IAtomContainer atomContainer, boolean ignoreElements, boolean ignoreBondOrders); @Override Invariant neighboursInBlock(Set<Integer> block, int vertexIndex); @Override int getVertexCount(); @Override int getConnectivity(int vertexI, int vertexJ); @Override Partition getInitialPartition();  }
@Test public void getConnectivity() { String acpString = "C0C1C2C3 0:1(1),1:2(2),2:3(3)"; IAtomContainer ac = AtomContainerPrinter.fromString(acpString, builder); AtomRefinable refinable = new AtomRefinable(ac); assertEquals(1, refinable.getConnectivity(0, 1)); assertEquals(2, refinable.getConnectivity(1, 2)); assertEquals(3, refinable.getConnectivity(2, 3)); }