WriterFactory { public IChemFormat[] findChemFormats(int features) { if (formats == null) loadFormats(); Iterator<IChemFormat> iter = formats.iterator(); List<IChemFormat> matches = new ArrayList<IChemFormat>(); while (iter.hasNext()) { IChemFormat format = (IChemFormat) iter.next(); if ((format.getSupportedDataFeatures() & features) == features) matches.add(format); } return (IChemFormat[]) matches.toArray(new IChemFormat[matches.size()]); } WriterFactory(); void registerWriter(Class<?> writer); IChemFormat[] findChemFormats(int features); int formatCount(); IChemObjectWriter createWriter(IChemFormat format);  }
@Test public void testFindChemFormats() { IChemFormat[] formats = factory.findChemFormats(DataFeatures.HAS_3D_COORDINATES); Assert.assertNotNull(formats); Assert.assertTrue(formats.length > 0); }