### Question:
ResourceHashModel implements TemplateHashModelEx, TemplateScalarModel, ResourceTemplate { @Override public int size() throws TemplateModelException { StmtIterator iterator = resource.listProperties(); return iterator.toList().size(); } ResourceHashModel(Resource resource); @Override int size(); @Override TemplateCollectionModel keys(); @Override TemplateCollectionModel values(); @Override TemplateModel get(String s); @Override boolean isEmpty(); @Override String getAsString(); @Override Resource getResource(); final static String INVALID_URL; }### Answer:
@Test public void testDefaultProvidedNameSpaces() { PrefixMapping prefixMapping = resourceHashModel.prefixMapping; assertTrue(prefixMapping.getNsPrefixMap().size() >= 5); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("dc:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("rdfs:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("owl:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("xsd:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("rdf:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("foaf:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("geo:")); assertEquals("Unexpected expanded prefix", "http: prefixMapping.expandPrefix("dcterms:")); }
@Test public void testSize() throws TemplateModelException { assertEquals("Unexpected size", KEY_SIZE, resourceHashModel.size()); }