### Question:
DefaultModelIndex implements ModelIndex { @Override public Type getType(final Identifier reference) { if (elementMap.containsKey(reference)) { final ModelElement element = elementMap.get(reference); if (element instanceof Type) { return (Type) element; } else { throw new IllegalArgumentException(reference.toString()); } } else { throw new IllegalArgumentException(reference.toString()); } } DefaultModelIndex(final Model model); @Override List<AssociationEnd> getAssociationEnds(final Identifier type); @Override Map<String, ClassType> getClassTypes(); @Override String getNamespaceURI(final Type type); @Override Map<QName, DataType> getDataTypes(); @Override Iterable<EnumType> getEnumTypes(); @Override List<Generalization> getGeneralizationBase(final Identifier derived); @Override List<Generalization> getGeneralizationDerived(final Identifier base); @Override TagDefinition getTagDefinition(final Identifier reference); @Override Type getType(final Identifier reference); @Override Set<ModelElement> whereUsed(final Identifier id); @Override TagDefinition getTagDefinition(final QName name); @Override Set<ModelElement> lookupByName(final QName name); @Override void lookup(final Identifier id, final Visitor visitor);  }### Answer:
@Test public void testGetType() { Type classType = modelIndex.getType(CLASSTYPE_ID); assertEquals(CLASSTYPE_NAME, classType.getName()); }