SingletonStrategy implements IResolveDependencyStrategy { public <T> T resolve(final Object... args) throws ResolveDependencyStrategyException { return (T) classInstance; } SingletonStrategy(final Object ... args); T resolve(final Object... args);  }
@Test public void checkStrategyResolution() throws Exception { Object value = new String("a"); Object other = new String("a"); IResolveDependencyStrategy strategy = new SingletonStrategy(value); Object result = strategy.resolve(); assertNotSame(value, other); assertEquals(value, result); assertSame(value, result); assertEquals(other, result); assertNotSame(other, result); }