### Question:
SelectorDoc { protected void appendClassTypeAssociations(StringBuffer stringBuffer, ClassType classType, ModelIndex modelIndex) { for (AssociationEnd associationEnd : modelIndex.getAssociationEnds(classType.getId())) { stringBuffer.append(String.format(FEATURE, ASSOCIATION, associationEnd.getName())); } } SelectorDoc(String inputXmiFilename, String outputXmlFilename); static void main(String[] args); static final String ATTRIBUTE; static final String ASSOCIATION; }### Answer:
@Test public void testAppendClassTypeAssociations() { this.selectorDoc.appendClassTypeAssociations(stringBuffer, CLASS_TYPE, MODEL_INDEX); String part1 = String.format(SelectorDoc.FEATURE, SelectorDoc.ASSOCIATION, ASSOCIATION_END1_NAME); String part2 = String.format(SelectorDoc.FEATURE, SelectorDoc.ASSOCIATION, ASSOCIATION_END2_NAME); String expectedToString = part1 + part2; assertEquals(expectedToString, stringBuffer.toString()); }