@Test public void invokesDestroyMethodWithDefaultLifecycleMethodStrategy() throws Exception { Resource instance = new Resource(); LifecycleComponent lifecycleComponent = new LifecycleComponent(instance); lifecycleComponent.destroy(); assertEquals(1, instance.destroyVisitsCounter.get()); }
public void destroy() { lifecycleStrategy.invokeDestroyMethods(component); }
LifecycleComponent { public void destroy() { lifecycleStrategy.invokeDestroyMethods(component); } }
LifecycleComponent { public void destroy() { lifecycleStrategy.invokeDestroyMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); }
LifecycleComponent { public void destroy() { lifecycleStrategy.invokeDestroyMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); void initialize(); void destroy(); Object getComponent(); }
LifecycleComponent { public void destroy() { lifecycleStrategy.invokeDestroyMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); void initialize(); void destroy(); Object getComponent();  }