### Question:
DefinitionLoader { static Type loadType(Class<?> clazz, TypeManager manager) { Objects.requireNonNull(clazz,"Class cannot be null"); Objects.requireNonNull(manager,"Type manager cannot be null"); return new TypeLoader(manager).load(clazz); } private  DefinitionLoader();   }### Answer:
@Test(expected=InvalidDefinitionException.class) public void testForClass$orphanClass$nullNamespace() throws Exception { Class<?> orphanClass = Class.forName("NullNamespaceOrphanType"); DefinitionLoader.loadType(orphanClass,manager); }
@Test(expected=InvalidDefinitionException.class) public void testForClass$orphanClass$emptyNamespace() throws Exception { Class<?> orphanClass = Class.forName("EmptyNamespaceOrphanType"); DefinitionLoader.loadType(orphanClass,manager); }
@Test public void testForClass$unnamed$fallback$simple() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(SimpleUnnamedFallbackType.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo(SimpleUnnamedFallbackType.class.getSimpleName())); }
@Test public void testForClass$unnamed$fallback$complex() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(ComplexUnnamedFallbackType.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo(ComplexUnnamedFallbackType.class.getSimpleName())); }
@Test public void testForClass$named$fallback$simple() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(SimpleNamedFallbackType.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo(SimpleNamedFallbackType.NAME)); }
@Test public void testForClass$named$fallback$complex() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(ComplexNamedFallbackType.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo(ComplexNamedFallbackType.NAME)); }
@Test public void testForClass$unnamed$vocabularyNamespace() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(Service.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo(Service.class.getSimpleName())); }
@Test public void testForClass$named$vocabularyNamespace() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(Control.class,manager); assertThat(sut.getNamespace(),equalTo("http: assertThat(sut.getName(),equalTo("HypermediaControl")); }
@Test public void testForClass$defined() throws Exception { org.ldp4j.rdf.bean.Type sut = DefinitionLoader.loadType(DefinitionLoaderTest.class,manager); assertThat(sut.getNamespace(),equalTo(NAMESPACE)); assertThat(sut.getName(),equalTo(NAME)); }