Resource { public Resource getOrigin() { return origin; } Resource(String path, Resource origin); String getPath(); Resource getOrigin(); boolean isXml(); String getContent(); SortedMap<String, String> getMap(); @Override String toString(); static String readText(Reader reader);  }
@Test public void testGetOrigin() throws Exception { TestResource r1 = new TestResource("r1", "key = value", null); TestResource r2 = new TestResource("r2", "key2 = value2", r1); assertNull(r1.getOrigin()); assertNotNull(r2.getOrigin()); assertSame(r1, r2.getOrigin()); }