public void testAppend()
{
model.read(getFileName("ontology/list5.rdf"));
final Resource nil = model.getResource(RDF.nil.getURI());
RDFList list = nil.as(RDFList.class);
final Resource r = model.createResource(TestList.NS + "foo");
// create a list of foos
for (int i = 0; i < 5; i++)
{
list = list.cons(r);
}
final int listLen = list.size();
// now append foos to the root list
final RDFList root = getListRoot(model);
final int rootLen = root.size();
final RDFList appended = root.append(list);
// original list should be unchanged
checkValid("appendTest0", root, true);
Assert.assertEquals("Original list should be unchanged", rootLen,
root.size());
checkValid("appendTest1", list, true);
Assert.assertEquals("Original list should be unchanged", listLen,
list.size());
// new list should be length of combined
checkValid("appendTest2", appended, true);
Assert.assertEquals("Appended list not correct length", rootLen
+ listLen, appended.size());
}