ClassLoaderLeakPreventorFactory { public void addCleanUp(ClassLoaderPreMortemCleanUp classLoaderPreMortemCleanUp) { addConsideringOrder(this.cleanUps, classLoaderPreMortemCleanUp); } ClassLoaderLeakPreventorFactory();  ClassLoaderLeakPreventorFactory(ClassLoader leakSafeClassLoader); void configureDefaults(); ClassLoaderLeakPreventor newLeakPreventor(); ClassLoaderLeakPreventor newLeakPreventor(ClassLoader classLoader); void setLogger(Logger logger); void addPreInitiator(PreClassLoaderInitiator preClassLoaderInitiator); void addCleanUp(ClassLoaderPreMortemCleanUp classLoaderPreMortemCleanUp); void addCleanUp(String name, ClassLoaderPreMortemCleanUp classLoaderPreMortemCleanUp); void clearPreInitiators(); void clearCleanUps(); C getPreInitiator(Class<C> clazz); C getCleanUp(Class<C> clazz); void removePreInitiator(Class<C> clazz); void removeCleanUp(Class<C> clazz);  }
@Test(expected = IllegalStateException.class) public void circularMustBeAfter() { ClassLoaderLeakPreventorFactory factory = new ClassLoaderLeakPreventorFactory(); factory.addCleanUp(new Circle1()); factory.addCleanUp(new Circle2()); }