SynFunctionTreeModel extends AbstractTreeTableModel implements ISyntacticalFunctionProvider { @Override public List<List<AbstractSyntacticalFunctionElement>> provideFunctions() { final List<List<AbstractSyntacticalFunctionElement>> result; result = new ArrayList<>(this.topLevelGrouping.size()); for (final List<UUID> singleGroup : this.topLevelGrouping.values()) { final List<AbstractSyntacticalFunctionElement> topLevelList = new ArrayList<>(singleGroup.size()); for (final UUID singleTopLevelReference : singleGroup) { topLevelList.add(this.deriveModelInstance(singleTopLevelReference)); } result.add(topLevelList); } return result; } SynFunctionTreeModel(); void reset(final ISyntacticalFunctionProvider provider); @Override List<List<AbstractSyntacticalFunctionElement>> provideFunctions(); @Override int getColumnCount(); @Override boolean isCellEditable(final Object reference, final int columnIndex); @Override Object getValueAt(final Object reference, final int columnIndex); @Override UUID getChild(final Object parentReference, final int childIndex); @Override int getChildCount(final Object parentReference); @Override int getIndexOfChild(final Object parentReference, final Object childReference); TreePath addSynFunctionRow(final TreePath parentPath); TreePath addGroupRow(final TreePath parentPath); TreePath addTopLevelGroup(); void moveEntry(final TreePath targetPath, final boolean moveDown); void removeEntry(final TreePath targetPath); void updatedRow(final TreePath updatedPath);  }
@Test public void testProvideFunctions() { final List<List<AbstractSyntacticalFunctionElement>> expectedElements = SynFunctionTreeModelTest.functionProvider.provideFunctions(); final List<List<AbstractSyntacticalFunctionElement>> actualElements = this.model.provideFunctions(); Assert.assertNotSame(expectedElements, actualElements); Assert.assertEquals(expectedElements, actualElements); }