### Question:
DataTypeListItemView implements DataTypeListItem.View { @Override public void expand() { final Element parent = getRowElement(getDataType()); final int parentPositionY = presenter.getPositionY(parent); final AtomicInteger i = new AtomicInteger(1); asDownArrow(getArrow()); forEachChildElement(parent, child -> { show(child); double positionY = parentPositionY + (i.getAndIncrement() / 10.0); presenter.setPositionY(child, positionY); return !isCollapsed(child.querySelector(ARROW_BUTTON_SELECTOR)); }); presenter.refreshItemsCSSAndHTMLPosition(); } @Inject  DataTypeListItemView(final HTMLDivElement view,
                                final TranslationService translationService,
                                final @DMNEditor ReadOnlyProvider readOnlyProvider); @Override void init(final DataTypeListItem presenter); @Override HTMLElement getElement(); @Override void toggleArrow(final boolean show); @Override void expand(); @Override void collapse(); @Override void showEditButton(); @Override void showSaveButton(); @Override void enableFocusMode(); @Override void disableFocusMode(); @Override boolean isOnFocusMode(); @Override String getName(); @Override void setName(final String name); @Override void showDataTypeNameInput(); @Override void hideDataTypeNameInput(); @Override void setupSelectComponent(final DataTypeSelect typeSelect); @Override void setupConstraintComponent(final DataTypeConstraint dataTypeConstraintComponent); @Override void setupListComponent(final SmallSwitchComponent dataTypeListComponent); @Override void showListContainer(); @Override void hideListContainer(); @Override void showListYesLabel(); @Override void hideListYesLabel(); @Override boolean isCollapsed(); @Override void setDataType(final DataType dataType); static final String UUID_ATTR; static final String NAME_DATA_FIELD; static final String PARENT_UUID_ATTR; }### Answer:
@Test public void testExpand() { final HTMLElement arrow = mock(HTMLElement.class); final DOMTokenList arrowClassList = mock(DOMTokenList.class); doReturn(arrow).when(view).getArrow(); doReturn(false).when(view).isCollapsed(any()); arrow.classList = arrowClassList; final DataType parentDataType = mock(DataType.class); final String parentDataTypeUUID = "parentDataTypeUUID"; final Element parentElement = mock(Element.class); final Element child1 = makeChildElement("child1UUID"); final Element child2 = makeChildElement("child2UUID"); final NodeList<Element> children = spy(new NodeList<>()); when(parentDataType.getUUID()).thenReturn(parentDataTypeUUID); when(parentElement.getAttribute("data-row-uuid")).thenReturn(parentDataTypeUUID); doReturn(parentDataType).when(view).getDataType(); doReturn(child1).when(children).getAt(0); doReturn(child2).when(children).getAt(1); mockDOMElementByUUID(parentDataTypeUUID, parentElement); mockDOMElementsByParentUUID(parentDataTypeUUID, children); children.length = 2; view.expand(); verify(arrowClassList).add(DOWN_ARROW_CSS_CLASS); verify(arrowClassList).remove(RIGHT_ARROW_CSS_CLASS); verify(child1.classList).remove(HIDDEN_CSS_CLASS); verify(child2.classList).remove(HIDDEN_CSS_CLASS); }