String testPath = "ondemand/test";
Resource r1 = registry.newResource();
r1.setContent("This is test content. It should not be loaded unless getContent() is called.".getBytes());
registry.put(testPath, r1);
OnDemandContentResourceImpl r1_get = (OnDemandContentResourceImpl) registry.get(testPath);
r1_get.setClient(null);
Object content = null;
try {
content = r1_get.getContent();
assertNull("Resource content should not exist",content);
fail("Content has not been pre-fetched, not on demand");
} catch (Exception e) {
e.printStackTrace(); // printing stack trace for verification.
}