BioPAXFactory { public boolean canInstantiate(Class<? extends BioPAXElement> aClass) { try { String cname = mapClassName(aClass); return !Modifier.isAbstract(Class.forName(cname).getModifiers()); } catch (ClassNotFoundException e) { return false; } catch (Exception ex) { log.error("Error in canInstantiate(" + aClass + ")", ex); return false; } } protected  BioPAXFactory(); abstract BioPAXLevel getLevel(); BioPAXElement create(String localName, String uri); T create(Class<T> aClass, String uri); abstract String mapClassName(Class<? extends BioPAXElement> aClass); boolean canInstantiate(Class<? extends BioPAXElement> aClass); Model createModel(); Class<T> getImplClass(Class<T> aModelInterfaceClass);  }
@Test public void canInstantiate() throws Exception { assertTrue(factory.canInstantiate(SequenceSite.class)); assertFalse(factory.canInstantiate(Process.class)); assertFalse(factory.canInstantiate(EntityReference.class)); assertFalse(factory.canInstantiate(SimplePhysicalEntity.class)); }