### Question:
ObjectRegistry { public Type getOmaResourceType(String uriPath) throws InvalidResourceURIException { try { String[] path = uriPath.split("/"); if (path.length < 4) { throw new InvalidResourceURIException(uriPath + " does not match /{object-id}/{object-instance-id}/{resource-id}"); } ObjectModel object = getObjectModel(path[1]); ResourceModel resource = object.getResourceModel(path[3]); return resource.getType(); } catch (NotFoundException exception) { return null; } } private  ObjectRegistry();  ObjectRegistry(List<ObjectModel> objects); static ObjectRegistry createObjectRegistry(); static ObjectRegistry createObjectRegistry(Reader reader); void addObjectModels(List<ObjectModel> models); List<ObjectModel> getObjectModels(); Type getOmaResourceType(String uriPath); ObjectModel getObjectModel(String id); @Override String toString();  }### Answer:
@Test public void getTypeOfResourceOfMultipleObject() throws Exception { Type type = registry.getOmaResourceType("/0/0/0"); assertEquals(STRING, type); }
@Test public void getTypeOfResourceOfSingleObject() throws Exception { Type type = registry.getOmaResourceType("/3/0/4"); assertEquals(EXECUTABLE, type); }
@Test(expected = InvalidResourceURIException.class) public void getTypeOfResourceWithObjectURI() throws Exception { registry.getOmaResourceType("/3"); }
@Test public void getTypeOfUnknownResourceOfKnownObject() throws Exception { assertNull(registry.getOmaResourceType("/0/0/unknown")); }
@Test public void getTypeOfResourceOfUnknownObject() throws Exception { assertNull(registry.getOmaResourceType("/.unknown }
@Test(expected = InvalidResourceURIException.class) public void getTypeOfInvalidResourceURI() throws Exception { registry.getOmaResourceType("invalid"); }
@Test(expected = NullPointerException.class) public void getTypeOfNullResourceURI() throws Exception { registry.getOmaResourceType(null); }