JpaUnitObjectFactory implements ObjectFactory { @Override public void stop() { for (final Class<?> clazz : definitions.keySet()) { try { executor.processAfterAll(invocationsMap.get(clazz)); } catch (final Exception e) { LOG.error("Failed to run after all hook", e); } } definitions.clear(); }  @Override void start(); @Override void stop(); @Override boolean addClass(final Class<?> glueClass); @Override T getInstance(final Class<T> clazz);  }
@Test public void testStopDoesNotHaveAnyEffectsIfNoInstancesWereCreated() { factory.stop(); verifyZeroInteractions(executor); }