### Question:
Resource { public void load() { if (!isLoaded()) data = dataLoader.load(); } protected  Resource(DataLoader<T> dataLoader); protected  Resource(DataLoader<T> dataLoader, boolean deferred); T get(); void set(T data); DataLoader<T> getDataLoader(); void setDataLoader(DataLoader<T> dataLoader); void reload(); void load(); void unload(); boolean isLoaded(); Resource<T> clone();  }### Answer:
@Test public void dataShouldBeLoadedOnConstructorWhenNotDeferred() { String data = "helloworld"; DataLoader dataLoader = createMock(DataLoader.class); expect(dataLoader.load()).andReturn(data); replay(dataLoader); new Resource<String>(dataLoader, false); verify(dataLoader); }