### Question:
LeafItem extends Item { @Override LeafItem createLeaf (String[] names, int position) { if (position != names.length) { throw new ExecutionException ("leaf item cannot have children"); } return this; } LeafItem(String name, Item parent);   }### Answer:
@Test public void testCreateLeaf () { assertNotNull (new LeafItem (NAME, null).createLeaf (new String[] { "structure", NAME }, 2)); }
@Test public void testCreateLeaf22222 () { try { new LeafItem (NAME, null).createLeaf (new String[] { "structure", NAME, "more" }, 2); fail ("no exception"); } catch (ExecutionException ee) { } }