LanguageTreeModel extends AbstractTreeTableModel { boolean isModelAtPathUserDefined(final TreePath path) { if (path == null || path.getPathCount() < 2) { return false; } return this.getRowIndexOfNode(path.getLastPathComponent()) >= this.systemModelCount; } LanguageTreeModel(final ILanguageOptionHandler options); @Override int getColumnCount(); @Override UUID getChild(final Object parentNode, final int index); @Override int getChildCount(final Object parentNode); @Override int getIndexOfChild(final Object parentNode, final Object childNode); @Override boolean isCellEditable(final Object node, final int columnIndex); @Override Object getValueAt(final Object node, final int columnIndex);  }
@Test public void testIsModelAtPathUserDefined() { final TreePath rootPath = new TreePath(this.root); final UUID referenceSystemModelB = this.model.getChild(this.root, 1); final UUID referenceUserModelC = this.model.getChild(this.root, 2); final UUID referenceUserModelD = this.model.getChild(this.root, 3); Assert.assertFalse(this.model.isModelAtPathUserDefined(null)); Assert.assertFalse(this.model.isModelAtPathUserDefined(rootPath)); Assert.assertFalse(this.model.isModelAtPathUserDefined(rootPath.pathByAddingChild(referenceSystemModelB))); Assert.assertTrue(this.model.isModelAtPathUserDefined(rootPath.pathByAddingChild(referenceUserModelC))); Assert.assertTrue(this.model.isModelAtPathUserDefined(rootPath.pathByAddingChild(referenceUserModelD))); }