### Question:
MetadataRegistry { public TypeInfo getTypeInfo(Class<? extends PresentationModel> modelClass) { TypeInfo result = modelTypes.get(modelClass); if (result == null) { result = createTypeInfo(modelClass); } return result; } MetadataRegistry(); TypeInfo getTypeInfo(Class<? extends PresentationModel> modelClass); PathNode getPathNode(Class<? extends PresentationModel> modelClass); PathNode getPathNode(TypeInfo typeInfo);  }### Answer:
@Test public void describeTextPM() { Class cls = TextPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getProperties().size()", 0, info.getProperties().size()); assertEquals("info.getJavaType()", cls, info.getJavaType()); TypeInfo info2 = this.metadata.getTypeInfo(cls); assertEquals("info2", info, info2); }
@Test public void describeListPM() { Class cls = ListPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getProperties().size()", 0, info.getProperties().size()); assertEquals("info.getJavaType()", cls, info.getJavaType()); }
@Test public void describeListOfFilePM() { Class cls = ListOfFilePM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getProperties().size()", 0, info.getProperties().size()); assertEquals("info.getJavaType()", cls, info.getJavaType()); }
@Test public void describeFilePM() { Class cls = FilePM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); assertEquals("info.getProperties().size()", 1, info.getProperties().size()); PropertyInfo pdesc = info.getProperties().iterator().next(); assertEquals("pdesc.getName()", "path", pdesc.getName()); TypeInfo typeInfo = pdesc.getTypeInfo(); assertEquals("textCellInfo", this.metadata.getTypeInfo(TextPM.class), typeInfo); }
@Test public void describeDirectoryPM() { Class cls = DirectoryPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); assertEquals("info.getProperties().size()", 3, info.getProperties().size()); PropertyInfo pInfo = info.getProperty("parent"); assertNotNull("pInfo", pInfo); }
@Test public void describeAnotherDirectoryPM() { Class cls = AnotherDirectoryPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); assertEquals("info.getProperties().size()", 2, info.getProperties().size()); }
@Test public void describeAnotherDirectoryPM2() { Class cls = AnotherDirectoryPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); PropertyInfo pInfo = info.getProperty("listOfFiles"); }
@Test public void describeDirectoryPM2() { Class cls = DirectoryPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); PropertyInfo pInfo = info.getProperty("files"); }
@Test public void describeThirdDirectoryPM() { Class cls = ThirdDirectoryPM.class; TypeInfo info = this.metadata.getTypeInfo(cls); assertEquals("info.getJavaType()", cls, info.getJavaType()); PropertyInfo pInfo = info.getProperty("files"); }