InstanceFactory implements Factory<T> { private InstanceFactory(T instance) { this.instance = instance; } private  InstanceFactory(T instance); static Factory<T> create(T instance); @Override T get();  }
@Test public void instanceFactory() { Object instance = new Object(); Factory<Object> factory = InstanceFactory.create(instance); assert_().that(factory.get()).isEqualTo(instance); assert_().that(factory.get()).isEqualTo(instance); assert_().that(factory.get()).isEqualTo(instance); }