### Question:
DataTypeUrl { public DataType getDataType(DataTypeManagerService service) { DataTypeManager manager = findManager(service); if (manager == null) { return null; } if (dataTypeId == null) { return manager.getDataType(new DataTypePath(CategoryPath.ROOT, dataTypeName)); } DataType dt = manager.findDataTypeForID(dataTypeId); return dt; } DataTypeUrl(DataType dt);  DataTypeUrl(String url); UniversalID getDataTypeManagerId(); UniversalID getDataTypeId(); String getDataTypeName(); DataType getDataType(DataTypeManagerService service); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testGetDataType() { String name = "string"; String dtmId = "3295333330922457057"; FakeDataTypeManager manager = new FakeDataTypeManager(dtmId); FakeDataType dt = new FakeDataType(name, manager); DataTypeUrl dtUrl = new DataTypeUrl(dt); DataTypeManagerService service = new FakeDataTypeManagerService(manager); DataType actualDt = dtUrl.getDataType(service); assertEquals(dt, actualDt); }
@Test public void testGetDataType_ByName() { String name = "string"; String dtmId = "3295333330922457057"; FakeDataTypeManager manager = new FakeDataTypeManager(dtmId); FakeDataType dt = new FakeDataType(name, manager); String dtId = ""; String urlString = "datatype:/" + dtmId + "?uid=" + dtId + "&name=" + name; DataTypeUrl dtUrl = new DataTypeUrl(urlString); DataTypeManagerService service = new FakeDataTypeManagerService(manager); DataType actualDt = dtUrl.getDataType(service); assertEquals(dt, actualDt); }