GeometricCumulativeDoubleBondFactory implements StereoEncoderFactory { static StereoEncoder axialEncoder(IAtomContainer container, IAtom start, IAtom end) { List<IBond> startBonds = container.getConnectedBondsList(start); List<IBond> endBonds = container.getConnectedBondsList(end); if (startBonds.size() < 2 || endBonds.size() < 2) return null; if (has2DCoordinates(startBonds) && has2DCoordinates(endBonds)) { return axial2DEncoder(container, start, startBonds, end, endBonds); } else if (has3DCoordinates(startBonds) && has3DCoordinates(endBonds)) { return axial3DEncoder(container, start, startBonds, end, endBonds); } return null; }  @Override StereoEncoder create(IAtomContainer container, int[][] graph);  }
@Test public void testAxialEncoder_Empty() throws Exception { IAtomContainer container = mock(IAtomContainer.class); IAtom start = mock(IAtom.class); IAtom end = mock(IAtom.class); when(container.getConnectedBondsList(start)).thenReturn(Collections.<IBond> emptyList()); when(container.getConnectedBondsList(end)).thenReturn(Collections.<IBond> emptyList()); assertNull(GeometricCumulativeDoubleBondFactory.axialEncoder(container, start, end)); }