### Question:
ZkTreeModel extends DefaultTreeModel<E> { public TreeNode<E> removeSelected() { int[] selectionPath = getSelectionPath(); if (selectionPath == null) { return null; } return removeChild(selectionPath); } ZkTreeModel(@Nonnull TreeNode<E> root); TreeNode<E> find(@Nonnull E data); @Override TreeNode<E> getChild(int... path); E getChildData(int... path); E getSelectedData(@Nonnegative int depth); TreeNode<E> removeSelected(); TreeNode<E> removeChild(int... path); ZkTreeNode<E> addExpandableNode(E data, int... parentNodePath); void dropNodeBefore(TreeNode<E> node, TreeNode<E> target); void dropNodeIn(TreeNode<E> node, TreeNode<E> target); void setSelectedNode(TreeNode<E> node);  }### Answer:
@Test public void testRemoveSelected() { TreeNode<String> child = sut.getChild(1, 1); sut.addToSelection(child); sut.removeSelected(); assertTrue(sut.getSelection().isEmpty()); assertNotSame(sut.getChild(1, 1), child); }
@Test public void testRemoveSelected_withNoSelection() { assertNull(sut.removeSelected()); }