Enhancer { public Class<? extends T> getEnhancedClass() { if (enhancedClass == null) { synchronized (baseClass) { if (enhancedClass == null) { enhancedClass = enhanceClass(baseClass); } } } return enhancedClass; } protected  Enhancer(Class<T> baseClass); abstract boolean needsEnhancement(Object object); void validateClassIsEnhanceable(Class<T> baseClass); final Class<T> getBaseClass(); Class<? extends T> getEnhancedClass(); T newInstance(); T enhance(T t);  }
@Test public void enhancedClassIsNotSame() { assertNotSame(SampleClass.class, enhancer.getEnhancedClass()); }