harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [22/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTreeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTreeTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTreeTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTreeTest.java Sat Nov 25 16:04:10 2006
@@ -15,9 +15,9 @@
  *  limitations under the License.
  */
 /**
-* @author Anton Avtamonov, Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Anton Avtamonov, Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 import java.awt.Component;
@@ -34,7 +34,6 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Vector;
-
 import javax.swing.event.TreeExpansionEvent;
 import javax.swing.event.TreeExpansionListener;
 import javax.swing.event.TreeModelEvent;
@@ -59,35 +58,36 @@
 import javax.swing.tree.TreeSelectionModel;
 import javax.swing.tree.VariableHeightLayoutCache;
 
+@SuppressWarnings("serial")
 public class JTreeTest extends BasicSwingTestCase {
-
     protected JTree tree;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         tree = new JTree();
         tree.setCellRenderer(new DefaultTreeCellRenderer() {
+            @Override
             public FontMetrics getFontMetrics(Font f) {
                 return JTreeTest.this.getFontMetrics(f, 10, 10);
             }
         });
-
         propertyChangeController = new PropertyChangeController();
         tree.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         tree = null;
         propertyChangeController = null;
         super.tearDown();
     }
 
-
     public void testTreeSelectionRedirector() throws Exception {
         assertNull(tree.selectionRedirector);
-        DefaultTreeSelectionModel model = (DefaultTreeSelectionModel)tree.getSelectionModel();
-        assertFalse(hasListener(model.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class));
-
+        DefaultTreeSelectionModel model = (DefaultTreeSelectionModel) tree.getSelectionModel();
+        assertFalse(hasListener(model.getTreeSelectionListeners(),
+                JTree.TreeSelectionRedirector.class));
         final Marker marker = new Marker();
         tree.addTreeSelectionListener(new TreeSelectionListener() {
             public void valueChanged(final TreeSelectionEvent e) {
@@ -95,27 +95,27 @@
             }
         });
         assertNotNull(tree.selectionRedirector);
-        assertTrue(hasListener(model.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class));
-
+        assertTrue(hasListener(model.getTreeSelectionListeners(),
+                JTree.TreeSelectionRedirector.class));
         TreePath path = new TreePath("root");
         TreePath oldLead = new TreePath("old_lead");
         TreePath newLead = new TreePath("new_lead");
-        tree.selectionRedirector.valueChanged(new TreeSelectionEvent("any_source", path, true, oldLead, newLead));
+        tree.selectionRedirector.valueChanged(new TreeSelectionEvent("any_source", path, true,
+                oldLead, newLead));
         assertNotNull(marker.getAuxiliary());
-
-        TreeSelectionEvent redirectedEvent = (TreeSelectionEvent)marker.getAuxiliary();
+        TreeSelectionEvent redirectedEvent = (TreeSelectionEvent) marker.getAuxiliary();
         assertSame(tree, redirectedEvent.getSource());
         assertSame(path, redirectedEvent.getPath());
         assertTrue(redirectedEvent.isAddedPath());
         assertSame(oldLead, redirectedEvent.getOldLeadSelectionPath());
         assertSame(newLead, redirectedEvent.getNewLeadSelectionPath());
-
         DefaultTreeSelectionModel newModel = new DefaultTreeSelectionModel();
         tree.setSelectionModel(newModel);
-        assertTrue(hasListener(newModel.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class));
-
+        assertTrue(hasListener(newModel.getTreeSelectionListeners(),
+                JTree.TreeSelectionRedirector.class));
         tree.setSelectionModel(null);
-        assertTrue(hasListener(((DefaultTreeSelectionModel)tree.getSelectionModel()).getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class));
+        assertTrue(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel())
+                .getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class));
     }
 
     public void testJTree() {
@@ -128,7 +128,6 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.cellRenderer);
@@ -138,9 +137,8 @@
     }
 
     public void testJTreeTreeModel() {
-        DefaultTreeModel model =  new DefaultTreeModel(new DefaultMutableTreeNode("root"));
+        DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode("root"));
         tree = new JTree(model);
-
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -150,14 +148,12 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertEquals(model, tree.treeModel);
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
-        tree = new JTree((TreeModel)null);
+        tree = new JTree((TreeModel) null);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -167,7 +163,6 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNull(tree.treeModel);
@@ -190,14 +185,12 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertEquals(root, tree.treeModel.getRoot());
-        assertTrue(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertTrue(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
         tree = new JTree(root, false);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
@@ -208,14 +201,12 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertEquals(root, tree.treeModel.getRoot());
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
         tree = new JTree(null, false);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
@@ -226,12 +217,11 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNull(tree.treeModel.getRoot());
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
     }
 
@@ -247,15 +237,13 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertEquals(root, tree.treeModel.getRoot());
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
-        tree = new JTree((TreeNode)null);
+        tree = new JTree((TreeNode) null);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -265,17 +253,16 @@
         assertFalse(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNull(tree.treeModel.getRoot());
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
     }
 
     public void testJTreeObjectArray() {
-        Object[] nodes = new Object[] {"node1", "node2", "node3"};
+        Object[] nodes = new Object[] { "node1", "node2", "node3" };
         tree = new JTree(nodes);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
@@ -286,16 +273,14 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(3, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
-        tree = new JTree((Object[])null);
+        tree = new JTree((Object[]) null);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -305,18 +290,17 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(0, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
     }
 
     public void testJTreeVector() {
-        Vector nodes = new Vector();
+        Vector<String> nodes = new Vector<String>();
         nodes.add("node1");
         nodes.add("node2");
         nodes.add("node3");
@@ -330,16 +314,14 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(3, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
-        tree = new JTree((Vector)null);
+        tree = new JTree((Vector) null);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -349,18 +331,17 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(0, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
     }
 
     public void testJTreeHashtable() {
-        Hashtable nodes = new Hashtable();
+        Hashtable<String, String> nodes = new Hashtable<String, String>();
         nodes.put("node1", "node1");
         nodes.put("node2", "node2");
         nodes.put("node3", "node3");
@@ -374,16 +355,14 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(3, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
-
-        tree = new JTree((Hashtable)null);
+        tree = new JTree((Hashtable) null);
         assertFalse(tree.editable);
         assertFalse(tree.invokesStopCellEditing);
         assertFalse(tree.largeModel);
@@ -393,13 +372,12 @@
         assertTrue(tree.showsRootHandles);
         assertEquals(2, tree.toggleClickCount);
         assertEquals(20, tree.visibleRowCount);
-
         assertNotNull(tree.selectionModel);
         assertNull(tree.selectionRedirector);
         assertNotNull(tree.treeModel);
         assertNotNull(tree.treeModel.getRoot());
         assertEquals(0, tree.treeModel.getChildCount(tree.treeModel.getRoot()));
-        assertFalse(((DefaultTreeModel)tree.treeModel).asksAllowsChildren());
+        assertFalse(((DefaultTreeModel) tree.treeModel).asksAllowsChildren());
         assertNotNull(tree.treeModelListener);
     }
 
@@ -412,11 +390,13 @@
     public void testGetToolTipTextMouseEvent() {
         tree.setToolTipText("tip");
         tree.cellRenderer = new DefaultTreeCellRenderer() {
+            @Override
             public String getToolTipText() {
                 return "renderer tip";
             }
         };
-        assertEquals("renderer tip", tree.getToolTipText(new MouseEvent(tree, 0, 0, 0, 0, 0, 0, false)));
+        assertEquals("renderer tip", tree.getToolTipText(new MouseEvent(tree, 0, 0, 0, 0, 0, 0,
+                false)));
         assertNull(tree.getToolTipText(null));
     }
 
@@ -431,58 +411,47 @@
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
         DefaultMutableTreeNode child21 = new DefaultMutableTreeNode("child21");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
         root.add(child2);
         child2.add(child21);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path2 = rootPath.pathByAddingChild(child2);
-
         assertEquals(0, tree.getSelectionCount());
-
         tree.addSelectionInterval(0, 0);
         assertEquals(1, tree.getSelectionCount());
-
         tree.addSelectionInterval(1, 1);
         assertEquals(2, tree.getSelectionCount());
-
         tree.addSelectionInterval(-20, 20);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path1, path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path1, path2 }, tree
+                .getSelectionPaths());
         tree.expandPath(path1);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path1, path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path1, path2 }, tree
+                .getSelectionPaths());
         tree.addSelectionInterval(1, 2);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path1, path2, path11}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path1, path2, path11 }, tree
+                .getSelectionPaths());
         tree.removeSelectionInterval(0, 1);
-        assertEqualsIgnoreOrder(new TreePath[] {path11, path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path11, path2 }, tree.getSelectionPaths());
         tree.removeSelectionInterval(2, 2);
-        assertEqualsIgnoreOrder(new TreePath[] {path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path2 }, tree.getSelectionPaths());
         tree.removeSelectionInterval(0, 2);
-        assertEqualsIgnoreOrder(new TreePath[] {path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path2 }, tree.getSelectionPaths());
         tree.removeSelectionInterval(-1, 10);
         if (isHarmony()) {
             assertEquals(0, tree.getSelectionPaths().length);
         } else {
             assertNull(tree.getSelectionPaths());
         }
-
         tree.setSelectionInterval(3, 1);
-        assertEqualsIgnoreOrder(new TreePath[] {path1, path11, path2}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path1, path11, path2 }, tree
+                .getSelectionPaths());
         tree.setSelectionInterval(2, 2);
-        assertEqualsIgnoreOrder(new TreePath[] {path11}, tree.getSelectionPaths());
+        assertEqualsIgnoreOrder(new TreePath[] { path11 }, tree.getSelectionPaths());
     }
 
     public void testAddRemoveSelectionPathPathsRowRows() {
@@ -492,89 +461,78 @@
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
         DefaultMutableTreeNode child21 = new DefaultMutableTreeNode("child21");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
         root.add(child2);
         child2.add(child21);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
         TreePath path2 = rootPath.pathByAddingChild(child2);
         TreePath path21 = path2.pathByAddingChild(child21);
-
         assertEquals(0, tree.getSelectionCount());
-
         tree.addSelectionPath(path1);
-        assertEqualsIgnoreOrder(new TreePath[] {path1}, tree.getSelectionPaths());
-
-        tree.addSelectionPaths(new TreePath[] {rootPath, path11});
-        assertEqualsIgnoreOrder(new TreePath[] {path1, rootPath, path11}, tree.getSelectionPaths());
-
-        TreePath unexistedPath = rootPath.pathByAddingChild(new DefaultMutableTreeNode("unexisted"));
+        assertEqualsIgnoreOrder(new TreePath[] { path1 }, tree.getSelectionPaths());
+        tree.addSelectionPaths(new TreePath[] { rootPath, path11 });
+        assertEqualsIgnoreOrder(new TreePath[] { path1, rootPath, path11 }, tree
+                .getSelectionPaths());
+        TreePath unexistedPath = rootPath.pathByAddingChild(new DefaultMutableTreeNode(
+                "unexisted"));
         tree.addSelectionPath(unexistedPath);
-        assertEqualsIgnoreOrder(new TreePath[] {path1, rootPath, path11, unexistedPath}, tree.getSelectionPaths());
-
-        tree.removeSelectionPaths(new TreePath[] {rootPath, unexistedPath});
-        assertEqualsIgnoreOrder(new TreePath[] {path11, path1}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path1, rootPath, path11, unexistedPath }, tree
+                .getSelectionPaths());
+        tree.removeSelectionPaths(new TreePath[] { rootPath, unexistedPath });
+        assertEqualsIgnoreOrder(new TreePath[] { path11, path1 }, tree.getSelectionPaths());
         tree.removeSelectionPath(path11);
-        assertEqualsIgnoreOrder(new TreePath[] {path1}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path1 }, tree.getSelectionPaths());
         tree.expandPath(path2);
-        tree.addSelectionRows(new int[] {3, 4});
-        assertEqualsIgnoreOrder(new TreePath[] {path1, path2, path21}, tree.getSelectionPaths());
-
+        tree.addSelectionRows(new int[] { 3, 4 });
+        assertEqualsIgnoreOrder(new TreePath[] { path1, path2, path21 }, tree
+                .getSelectionPaths());
         tree.expandPath(path11);
-        tree.addSelectionRows(new int[] {0, 3});
-        assertEqualsIgnoreOrder(new TreePath[] {path1, path2, path21, rootPath, path111}, tree.getSelectionPaths());
-
-        tree.removeSelectionRows(new int[] {0, 2});
-        assertEqualsIgnoreOrder(new TreePath[] {path111, path2, path1, path21}, tree.getSelectionPaths());
-
+        tree.addSelectionRows(new int[] { 0, 3 });
+        assertEqualsIgnoreOrder(new TreePath[] { path1, path2, path21, rootPath, path111 },
+                tree.getSelectionPaths());
+        tree.removeSelectionRows(new int[] { 0, 2 });
+        assertEqualsIgnoreOrder(new TreePath[] { path111, path2, path1, path21 }, tree
+                .getSelectionPaths());
         tree.removeSelectionRow(3);
-        assertEqualsIgnoreOrder(new TreePath[] {path2, path1, path21}, tree.getSelectionPaths());
+        assertEqualsIgnoreOrder(new TreePath[] { path2, path1, path21 }, tree
+                .getSelectionPaths());
     }
 
     public void testAddGetRemoveTreeExpansionListener() {
         class ConcreteTreeExpansionListener implements TreeExpansionListener {
             public void treeCollapsed(TreeExpansionEvent e) {
             }
+
             public void treeExpanded(TreeExpansionEvent e) {
             }
-        };
+        }
+        ;
         TreeExpansionListener TreeExpansionListener1 = new ConcreteTreeExpansionListener();
         TreeExpansionListener TreeExpansionListener2 = new ConcreteTreeExpansionListener();
         TreeExpansionListener TreeExpansionListener3 = new ConcreteTreeExpansionListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = tree.getTreeExpansionListeners();
         int initialValue = listenersArray.length;
-
         tree.addTreeExpansionListener(TreeExpansionListener1);
         tree.addTreeExpansionListener(TreeExpansionListener2);
         tree.addTreeExpansionListener(TreeExpansionListener2);
-
         listenersArray = tree.getTreeExpansionListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         tree.removeTreeExpansionListener(TreeExpansionListener1);
         tree.addTreeExpansionListener(TreeExpansionListener3);
         tree.addTreeExpansionListener(TreeExpansionListener3);
         listenersArray = tree.getTreeExpansionListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         tree.removeTreeExpansionListener(TreeExpansionListener3);
         tree.removeTreeExpansionListener(TreeExpansionListener3);
         listenersArray = tree.getTreeExpansionListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         tree.removeTreeExpansionListener(TreeExpansionListener2);
         tree.removeTreeExpansionListener(TreeExpansionListener2);
         listenersArray = tree.getTreeExpansionListeners();
@@ -585,34 +543,28 @@
         class ConcreteTreeSelectionListener implements TreeSelectionListener {
             public void valueChanged(TreeSelectionEvent e) {
             }
-        };
+        }
+        ;
         TreeSelectionListener TreeSelectionListener1 = new ConcreteTreeSelectionListener();
         TreeSelectionListener TreeSelectionListener2 = new ConcreteTreeSelectionListener();
         TreeSelectionListener TreeSelectionListener3 = new ConcreteTreeSelectionListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = tree.getTreeSelectionListeners();
         int initialValue = listenersArray.length;
-
         tree.addTreeSelectionListener(TreeSelectionListener1);
         tree.addTreeSelectionListener(TreeSelectionListener2);
         tree.addTreeSelectionListener(TreeSelectionListener2);
-
         listenersArray = tree.getTreeSelectionListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         tree.removeTreeSelectionListener(TreeSelectionListener1);
         tree.addTreeSelectionListener(TreeSelectionListener3);
         tree.addTreeSelectionListener(TreeSelectionListener3);
         listenersArray = tree.getTreeSelectionListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         tree.removeTreeSelectionListener(TreeSelectionListener3);
         tree.removeTreeSelectionListener(TreeSelectionListener3);
         listenersArray = tree.getTreeSelectionListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         tree.removeTreeSelectionListener(TreeSelectionListener2);
         tree.removeTreeSelectionListener(TreeSelectionListener2);
         listenersArray = tree.getTreeSelectionListeners();
@@ -623,36 +575,31 @@
         class ConcreteTreeWillExpandListener implements TreeWillExpandListener {
             public void treeWillCollapse(TreeExpansionEvent e) throws ExpandVetoException {
             }
+
             public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {
             }
-        };
+        }
+        ;
         TreeWillExpandListener TreeWillExpandListener1 = new ConcreteTreeWillExpandListener();
         TreeWillExpandListener TreeWillExpandListener2 = new ConcreteTreeWillExpandListener();
         TreeWillExpandListener TreeWillExpandListener3 = new ConcreteTreeWillExpandListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = tree.getTreeWillExpandListeners();
         int initialValue = listenersArray.length;
-
         tree.addTreeWillExpandListener(TreeWillExpandListener1);
         tree.addTreeWillExpandListener(TreeWillExpandListener2);
         tree.addTreeWillExpandListener(TreeWillExpandListener2);
-
         listenersArray = tree.getTreeWillExpandListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         tree.removeTreeWillExpandListener(TreeWillExpandListener1);
         tree.addTreeWillExpandListener(TreeWillExpandListener3);
         tree.addTreeWillExpandListener(TreeWillExpandListener3);
         listenersArray = tree.getTreeWillExpandListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         tree.removeTreeWillExpandListener(TreeWillExpandListener3);
         tree.removeTreeWillExpandListener(TreeWillExpandListener3);
         listenersArray = tree.getTreeWillExpandListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         tree.removeTreeWillExpandListener(TreeWillExpandListener2);
         tree.removeTreeWillExpandListener(TreeWillExpandListener2);
         listenersArray = tree.getTreeWillExpandListeners();
@@ -664,17 +611,13 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         root.add(child1);
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
-
         assertEquals(0, tree.getSelectionCount());
         assertEquals(0, tree.getSelectionModel().getSelectionCount());
-
-        tree.addSelectionPaths(new TreePath[] {rootPath, path1});
+        tree.addSelectionPaths(new TreePath[] { rootPath, path1 });
         assertEquals(2, tree.getSelectionCount());
         assertEquals(2, tree.getSelectionModel().getSelectionCount());
-
         tree.clearSelection();
         assertEquals(0, tree.getSelectionCount());
         assertEquals(0, tree.getSelectionModel().getSelectionCount());
@@ -685,23 +628,17 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
-
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
-
         tree.clearToggledPaths();
         assertFalse(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
-
         tree.expandPath(path1);
         tree.clearToggledPaths();
         assertFalse(tree.isExpanded(rootPath));
@@ -711,87 +648,81 @@
     public void testConvertValueToText() {
         assertEquals("", tree.convertValueToText(null, false, false, true, 0, false));
         assertEquals("any", tree.convertValueToText("any", false, false, true, 0, false));
-        assertEquals("5", tree.convertValueToText(new Integer("5"), false, false, true, 0, false));
+        assertEquals("5", tree.convertValueToText(new Integer("5"), false, false, true, 0,
+                false));
     }
 
     public void testCreateTreeModel() {
-        Object obj1 = new Object[] {"node1", "node2", "node3"};
-        Vector obj2 = new Vector();
+        Object obj1 = new Object[] { "node1", "node2", "node3" };
+        Vector<String> obj2 = new Vector<String>();
         obj2.add("node1");
         obj2.add("node2");
         obj2.add("node3");
-        Hashtable obj3 = new Hashtable();
+        Hashtable<String, String> obj3 = new Hashtable<String, String>();
         obj3.put("node1", "value1");
         obj3.put("node2", "value3");
         obj3.put("node3", "value3");
         Object obj4 = "object";
-        List obj5 = new ArrayList();
+        List<String> obj5 = new ArrayList<String>();
         obj5.add("node1");
         obj5.add("node2");
         obj5.add("node3");
-        Object obj6 = new int[] {1, 2, 3};
-        Vector obj7 = new Vector();
-        Vector obj71 = new Vector();
+        Object obj6 = new int[] { 1, 2, 3 };
+        Vector<Vector<String>> obj7 = new Vector<Vector<String>>();
+        Vector<String> obj71 = new Vector<String>();
         obj71.add("node1");
         obj71.add("node2");
         obj7.add(obj71);
-
         TreeModel model = JTree.createTreeModel(obj1);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(3, model.getChildCount(model.getRoot()));
         assertTrue(model.getChild(model.getRoot(), 0) instanceof JTree.DynamicUtilTreeNode);
-
         model = JTree.createTreeModel(obj2);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(3, model.getChildCount(model.getRoot()));
         assertTrue(model.getChild(model.getRoot(), 0) instanceof JTree.DynamicUtilTreeNode);
-
         model = JTree.createTreeModel(obj3);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(3, model.getChildCount(model.getRoot()));
         assertTrue(model.getChild(model.getRoot(), 0) instanceof JTree.DynamicUtilTreeNode);
-        assertTrue(((String)((DefaultMutableTreeNode)((DefaultMutableTreeNode)model.getRoot()).getChildAt(0)).getUserObject()).startsWith("node"));
-
+        assertTrue(((String) ((DefaultMutableTreeNode) ((DefaultMutableTreeNode) model
+                .getRoot()).getChildAt(0)).getUserObject()).startsWith("node"));
         model = JTree.createTreeModel(obj4);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(0, model.getChildCount(model.getRoot()));
-
         model = JTree.createTreeModel(obj5);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(0, model.getChildCount(model.getRoot()));
-
         model = JTree.createTreeModel(obj6);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(0, model.getChildCount(model.getRoot()));
-
         model = JTree.createTreeModel(obj7);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(1, model.getChildCount(model.getRoot()));
-        DefaultMutableTreeNode child = (DefaultMutableTreeNode)((DefaultMutableTreeNode)model.getRoot()).getChildAt(0);
+        DefaultMutableTreeNode child = (DefaultMutableTreeNode) ((DefaultMutableTreeNode) model
+                .getRoot()).getChildAt(0);
         assertTrue(child instanceof JTree.DynamicUtilTreeNode);
         assertEquals(obj71, child.getUserObject());
         assertEquals(2, child.getChildCount());
         assertTrue(model.getChild(child, 0) instanceof JTree.DynamicUtilTreeNode);
-
-
         model = JTree.createTreeModel(null);
         assertTrue(model instanceof DefaultTreeModel);
         assertTrue(model.getRoot() instanceof DefaultMutableTreeNode);
-        assertEquals("root", ((DefaultMutableTreeNode)model.getRoot()).getUserObject());
+        assertEquals("root", ((DefaultMutableTreeNode) model.getRoot()).getUserObject());
         assertEquals(0, model.getChildCount(model.getRoot()));
     }
 
@@ -814,25 +745,20 @@
         root.add(child2);
         DefaultMutableTreeNode child21 = new DefaultMutableTreeNode();
         child2.add(child21);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
         TreePath path2 = rootPath.pathByAddingChild(child2);
         TreePath path21 = path1.pathByAddingChild(child21);
-
         tree.setExpandedState(path11, true);
-
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.treeModelListener.treeNodesChanged(new TreeModelEvent(tree, path1));
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
@@ -840,9 +766,9 @@
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         TreePath path12 = path1.pathByAddingChild(new DefaultMutableTreeNode());
-        tree.treeModelListener.treeNodesInserted(new TreeModelEvent(tree, path1, new int[] {1}, new Object[] {path12}));
+        tree.treeModelListener.treeNodesInserted(new TreeModelEvent(tree, path1,
+                new int[] { 1 }, new Object[] { path12 }));
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
@@ -850,15 +776,14 @@
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
-        tree.treeModelListener.treeNodesRemoved(new TreeModelEvent(tree, path1, new int[] {0}, new Object[] {child11}));
+        tree.treeModelListener.treeNodesRemoved(new TreeModelEvent(tree, path1,
+                new int[] { 0 }, new Object[] { child11 }));
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.setExpandedState(path11, true);
         tree.treeModelListener.treeNodesRemoved(new TreeModelEvent(tree, path1));
         assertTrue(tree.isExpanded(rootPath));
@@ -867,16 +792,15 @@
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.setExpandedState(path2, true);
-        tree.treeModelListener.treeNodesRemoved(new TreeModelEvent(tree, rootPath, new int[] {0 /*index is not important*/}, new Object[] {child2}));
+        tree.treeModelListener.treeNodesRemoved(new TreeModelEvent(tree, rootPath,
+                new int[] { 0 /*index is not important*/}, new Object[] { child2 }));
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.setExpandedState(path11, true);
         tree.setExpandedState(path2, true);
         assertTrue(tree.isExpanded(rootPath));
@@ -885,7 +809,6 @@
         assertFalse(tree.isExpanded(path111));
         assertTrue(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.treeModelListener.treeStructureChanged(new TreeModelEvent(tree, rootPath));
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
@@ -893,10 +816,10 @@
         assertFalse(tree.isExpanded(path111));
         assertFalse(tree.isExpanded(path2));
         assertFalse(tree.isExpanded(path21));
-
         tree.setExpandedState(path11, true);
         tree.setExpandedState(path2, true);
-        tree.treeModelListener.treeStructureChanged(new TreeModelEvent("any", rootPath, new int[] {0}, new Object[] {child1}));
+        tree.treeModelListener.treeStructureChanged(new TreeModelEvent("any", rootPath,
+                new int[] { 0 }, new Object[] { child1 }));
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
@@ -910,106 +833,87 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
-
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.expandPath(path11);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapseRow(0);
         assertFalse(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.expandPath(path111);
         assertFalse(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.expandPath(path11);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapsePath(path1);
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapsePath(path11);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapsePath(path111);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapseRow(1);
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.expandRow(1);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapseRow(2);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.expandRow(10);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapseRow(10);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         tree.collapseRow(-1);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path111));
-
         DefaultMutableTreeNode unexisted = new DefaultMutableTreeNode("unexisted");
         TreePath unexistedPath = rootPath.pathByAddingChild(unexisted);
         tree.expandPath(unexistedPath);
         assertFalse(tree.isExpanded(unexistedPath));
-
         unexisted.add(new DefaultMutableTreeNode());
         tree.expandPath(unexistedPath);
         assertTrue(tree.isExpanded(unexistedPath));
@@ -1020,32 +924,25 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
-
         assertTrue(tree.hasBeenExpanded(rootPath));
         assertFalse(tree.hasBeenExpanded(path1));
         assertFalse(tree.hasBeenExpanded(path11));
-
         tree.expandPath(path11);
         assertTrue(tree.hasBeenExpanded(rootPath));
         assertTrue(tree.hasBeenExpanded(path1));
         assertTrue(tree.hasBeenExpanded(path11));
-
         tree.expandPath(path1);
         assertTrue(tree.hasBeenExpanded(rootPath));
         assertTrue(tree.hasBeenExpanded(path1));
         assertTrue(tree.hasBeenExpanded(path11));
-
-        ((DefaultTreeModel)tree.getModel()).removeNodeFromParent(child11);
+        ((DefaultTreeModel) tree.getModel()).removeNodeFromParent(child11);
         assertTrue(tree.hasBeenExpanded(rootPath));
         if (isHarmony()) {
             assertTrue(tree.hasBeenExpanded(path1));
@@ -1053,7 +950,6 @@
             assertFalse(tree.hasBeenExpanded(path1));
         }
         assertFalse(tree.hasBeenExpanded(path11));
-
         assertFalse(tree.hasBeenExpanded(null));
     }
 
@@ -1065,65 +961,65 @@
                 expandMarker.setOccurred();
                 expandMarker.setAuxiliary(event);
             }
+
             public void treeCollapsed(final TreeExpansionEvent event) {
                 collapseMarker.setOccurred();
                 collapseMarker.setAuxiliary(event);
             }
         });
-
         final Marker willExpandMarker = new Marker();
         final Marker willCollapseMarker = new Marker();
         tree.addTreeWillExpandListener(new TreeWillExpandListener() {
-            public void treeWillExpand(final TreeExpansionEvent event) throws ExpandVetoException {
+            public void treeWillExpand(final TreeExpansionEvent event)
+                    throws ExpandVetoException {
                 willExpandMarker.setOccurred();
                 willExpandMarker.setAuxiliary(event);
             }
-            public void treeWillCollapse(final TreeExpansionEvent event) throws ExpandVetoException {
+
+            public void treeWillCollapse(final TreeExpansionEvent event)
+                    throws ExpandVetoException {
                 willCollapseMarker.setOccurred();
                 willCollapseMarker.setAuxiliary(event);
             }
         });
-
-        TreePath eventPath = new TreePath(new DefaultMutableTreeNode("anyRoot")).pathByAddingChild(new DefaultMutableTreeNode("anyNode"));
+        TreePath eventPath = new TreePath(new DefaultMutableTreeNode("anyRoot"))
+                .pathByAddingChild(new DefaultMutableTreeNode("anyNode"));
         tree.setExpandedState(eventPath, true);
         assertTrue(willExpandMarker.isOccurred());
         assertTrue(expandMarker.isOccurred());
         assertFalse(willCollapseMarker.isOccurred());
         assertFalse(collapseMarker.isOccurred());
-        assertSame(eventPath, ((TreeExpansionEvent)willExpandMarker.getAuxiliary()).getPath());
-        assertSame(eventPath, ((TreeExpansionEvent)expandMarker.getAuxiliary()).getPath());
-
+        assertSame(eventPath, ((TreeExpansionEvent) willExpandMarker.getAuxiliary()).getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) expandMarker.getAuxiliary()).getPath());
         expandMarker.reset();
         willExpandMarker.reset();
         collapseMarker.reset();
         willCollapseMarker.reset();
-
         tree.setExpandedState(eventPath, false);
         assertFalse(willExpandMarker.isOccurred());
         assertFalse(expandMarker.isOccurred());
         assertTrue(willCollapseMarker.isOccurred());
         assertTrue(collapseMarker.isOccurred());
-        assertSame(eventPath, ((TreeExpansionEvent)willCollapseMarker.getAuxiliary()).getPath());
-        assertSame(eventPath, ((TreeExpansionEvent)collapseMarker.getAuxiliary()).getPath());
-
+        assertSame(eventPath, ((TreeExpansionEvent) willCollapseMarker.getAuxiliary())
+                .getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) collapseMarker.getAuxiliary()).getPath());
         expandMarker.reset();
         willExpandMarker.reset();
         collapseMarker.reset();
         willCollapseMarker.reset();
-
         tree.fireTreeExpanded(eventPath);
         tree.fireTreeCollapsed(eventPath);
         tree.fireTreeWillExpand(eventPath);
         tree.fireTreeWillCollapse(eventPath);
-
         assertTrue(willExpandMarker.isOccurred());
         assertTrue(expandMarker.isOccurred());
         assertTrue(willCollapseMarker.isOccurred());
         assertTrue(collapseMarker.isOccurred());
-        assertSame(eventPath, ((TreeExpansionEvent)willExpandMarker.getAuxiliary()).getPath());
-        assertSame(eventPath, ((TreeExpansionEvent)expandMarker.getAuxiliary()).getPath());
-        assertSame(eventPath, ((TreeExpansionEvent)willCollapseMarker.getAuxiliary()).getPath());
-        assertSame(eventPath, ((TreeExpansionEvent)collapseMarker.getAuxiliary()).getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) willExpandMarker.getAuxiliary()).getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) expandMarker.getAuxiliary()).getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) willCollapseMarker.getAuxiliary())
+                .getPath());
+        assertSame(eventPath, ((TreeExpansionEvent) collapseMarker.getAuxiliary()).getPath());
     }
 
     public void testFireValueChanged() {
@@ -1134,12 +1030,11 @@
                 changeMarker.setAuxiliary(e);
             }
         });
-
-        TreePath eventPath = new TreePath(new DefaultMutableTreeNode("anyRoot")).pathByAddingChild(new DefaultMutableTreeNode("anyNode"));
+        TreePath eventPath = new TreePath(new DefaultMutableTreeNode("anyRoot"))
+                .pathByAddingChild(new DefaultMutableTreeNode("anyNode"));
         tree.getSelectionModel().addSelectionPath(eventPath);
         assertTrue(changeMarker.isOccurred());
-        assertSame(eventPath, ((TreeSelectionEvent)changeMarker.getAuxiliary()).getPath());
-
+        assertSame(eventPath, ((TreeSelectionEvent) changeMarker.getAuxiliary()).getPath());
         changeMarker.reset();
         tree.fireValueChanged(null);
         assertTrue(changeMarker.isOccurred());
@@ -1150,10 +1045,8 @@
         TreePath path = new TreePath("unexisted");
         tree.setAnchorSelectionPath(path);
         assertSame(path, tree.getAnchorSelectionPath());
-
         tree.setAnchorSelectionPath(null);
         assertNull(tree.getAnchorSelectionPath());
-
         tree.getSelectionModel().addSelectionPath(path);
         assertSame(path, tree.getAnchorSelectionPath());
     }
@@ -1174,63 +1067,75 @@
         assertTrue(model1 instanceof DefaultTreeModel);
         assertNotSame(model1, model2);
         assertTrue(model1.getRoot() instanceof DefaultMutableTreeNode);
-        DefaultMutableTreeNode root = (DefaultMutableTreeNode)model1.getRoot();
+        DefaultMutableTreeNode root = (DefaultMutableTreeNode) model1.getRoot();
         assertEquals(3, root.getChildCount());
         assertEquals("JTree", root.getUserObject());
-
         assertTrue(root.getChildAt(0) instanceof DefaultMutableTreeNode);
-        DefaultMutableTreeNode node = (DefaultMutableTreeNode)root.getChildAt(0);
-
+        DefaultMutableTreeNode node = (DefaultMutableTreeNode) root.getChildAt(0);
         if (isHarmony()) {
             assertEquals("towns", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("Saint-Petersburg", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("New-York", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("Munchen", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("Oslo", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("Saint-Petersburg", ((DefaultMutableTreeNode) node.getChildAt(0))
+                    .getUserObject());
+            assertEquals("New-York", ((DefaultMutableTreeNode) node.getChildAt(1))
+                    .getUserObject());
+            assertEquals("Munchen", ((DefaultMutableTreeNode) node.getChildAt(2))
+                    .getUserObject());
+            assertEquals("Oslo", ((DefaultMutableTreeNode) node.getChildAt(3)).getUserObject());
         } else {
             assertEquals("colors", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("blue", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("violet", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("red", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("yellow", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("blue", ((DefaultMutableTreeNode) node.getChildAt(0)).getUserObject());
+            assertEquals("violet", ((DefaultMutableTreeNode) node.getChildAt(1))
+                    .getUserObject());
+            assertEquals("red", ((DefaultMutableTreeNode) node.getChildAt(2)).getUserObject());
+            assertEquals("yellow", ((DefaultMutableTreeNode) node.getChildAt(3))
+                    .getUserObject());
         }
-
         assertTrue(root.getChildAt(1) instanceof DefaultMutableTreeNode);
-        node = (DefaultMutableTreeNode)root.getChildAt(1);
+        node = (DefaultMutableTreeNode) root.getChildAt(1);
         if (isHarmony()) {
             assertEquals("animals", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("dog", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("tiger", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("wolf", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("bear", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("dog", ((DefaultMutableTreeNode) node.getChildAt(0)).getUserObject());
+            assertEquals("tiger", ((DefaultMutableTreeNode) node.getChildAt(1)).getUserObject());
+            assertEquals("wolf", ((DefaultMutableTreeNode) node.getChildAt(2)).getUserObject());
+            assertEquals("bear", ((DefaultMutableTreeNode) node.getChildAt(3)).getUserObject());
         } else {
             assertEquals("sports", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("basketball", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("soccer", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("football", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("hockey", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("basketball", ((DefaultMutableTreeNode) node.getChildAt(0))
+                    .getUserObject());
+            assertEquals("soccer", ((DefaultMutableTreeNode) node.getChildAt(1))
+                    .getUserObject());
+            assertEquals("football", ((DefaultMutableTreeNode) node.getChildAt(2))
+                    .getUserObject());
+            assertEquals("hockey", ((DefaultMutableTreeNode) node.getChildAt(3))
+                    .getUserObject());
         }
-
         assertTrue(root.getChildAt(2) instanceof DefaultMutableTreeNode);
-        node = (DefaultMutableTreeNode)root.getChildAt(2);
+        node = (DefaultMutableTreeNode) root.getChildAt(2);
         if (isHarmony()) {
             assertEquals("computers", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("notebook", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("desktop", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("server", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("mainframe", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("notebook", ((DefaultMutableTreeNode) node.getChildAt(0))
+                    .getUserObject());
+            assertEquals("desktop", ((DefaultMutableTreeNode) node.getChildAt(1))
+                    .getUserObject());
+            assertEquals("server", ((DefaultMutableTreeNode) node.getChildAt(2))
+                    .getUserObject());
+            assertEquals("mainframe", ((DefaultMutableTreeNode) node.getChildAt(3))
+                    .getUserObject());
         } else {
             assertEquals("food", node.getUserObject());
             assertEquals(4, node.getChildCount());
-            assertEquals("hot dogs", ((DefaultMutableTreeNode)node.getChildAt(0)).getUserObject());
-            assertEquals("pizza", ((DefaultMutableTreeNode)node.getChildAt(1)).getUserObject());
-            assertEquals("ravioli", ((DefaultMutableTreeNode)node.getChildAt(2)).getUserObject());
-            assertEquals("bananas", ((DefaultMutableTreeNode)node.getChildAt(3)).getUserObject());
+            assertEquals("hot dogs", ((DefaultMutableTreeNode) node.getChildAt(0))
+                    .getUserObject());
+            assertEquals("pizza", ((DefaultMutableTreeNode) node.getChildAt(1)).getUserObject());
+            assertEquals("ravioli", ((DefaultMutableTreeNode) node.getChildAt(2))
+                    .getUserObject());
+            assertEquals("bananas", ((DefaultMutableTreeNode) node.getChildAt(3))
+                    .getUserObject());
         }
     }
 
@@ -1239,31 +1144,27 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
-
         assertNull(tree.getDescendantToggledPaths(null));
-        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] {rootPath});
+        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] { rootPath });
         checkInEnumeration(tree.getDescendantToggledPaths(path1), new Object[] {});
         checkInEnumeration(tree.getDescendantToggledPaths(path11), new Object[] {});
-
         tree.expandPath(path11);
-        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] {path1, rootPath, path11});
-        checkInEnumeration(tree.getDescendantToggledPaths(path11), new Object[] {path11});
-
+        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] { path1,
+                rootPath, path11 });
+        checkInEnumeration(tree.getDescendantToggledPaths(path11), new Object[] { path11 });
         tree.collapsePath(path11);
-        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] {path1, rootPath, path11});
-
+        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] { path1,
+                rootPath, path11 });
         tree.collapsePath(rootPath);
-        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] {path1, rootPath, path11});
+        checkInEnumeration(tree.getDescendantToggledPaths(rootPath), new Object[] { path1,
+                rootPath, path11 });
     }
 
     public void testGetDragEnabled() {
@@ -1278,19 +1179,15 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
-
         assertNull(tree.getExpandedDescendants(null));
-        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] {rootPath});
+        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] { rootPath });
         if (isHarmony()) {
             assertFalse(tree.getExpandedDescendants(path1).hasMoreElements());
         } else {
@@ -1301,13 +1198,12 @@
         } else {
             assertNull(tree.getExpandedDescendants(path11));
         }
-
         tree.expandPath(path11);
-        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] {path1, rootPath, path11});
-
+        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] { path1,
+                rootPath, path11 });
         tree.collapsePath(path11);
-        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] {path1, rootPath});
-
+        checkInEnumeration(tree.getExpandedDescendants(rootPath), new Object[] { path1,
+                rootPath });
         tree.collapsePath(rootPath);
         if (isHarmony()) {
             assertFalse(tree.getExpandedDescendants(rootPath).hasMoreElements());
@@ -1332,7 +1228,6 @@
 
     public void testGetLastSelectedPathComponent() {
         assertNull(tree.getLastSelectedPathComponent());
-
         tree.setSelectionRow(1);
         assertTrue(tree.getLastSelectedPathComponent() instanceof DefaultMutableTreeNode);
         if (isHarmony()) {
@@ -1347,28 +1242,21 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
-
         assertEquals(-1, tree.getLeadSelectionRow());
         tree.setSelectionRow(10);
         assertEquals(-1, tree.getLeadSelectionRow());
-
         tree.setExpandsSelectedPaths(false);
         tree.setSelectionPath(path11);
         assertEquals(-1, tree.getLeadSelectionRow());
-
         tree.setLeadSelectionPath(path11);
         assertEquals(-1, tree.getLeadSelectionRow());
-
         tree.setLeadSelectionPath(path1);
         assertEquals(1, tree.getLeadSelectionRow());
     }
@@ -1378,29 +1266,23 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
-
         root.add(child1);
         child1.add(child11);
         root.add(child2);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path2 = rootPath.pathByAddingChild(child2);
-
-        tree.setSelectionPaths(new TreePath[] {path2, path11});
+        tree.setSelectionPaths(new TreePath[] { path2, path11 });
         assertEquals(2, tree.getMinSelectionRow());
         assertEquals(3, tree.getMaxSelectionRow());
-
         tree.collapsePath(path1);
-        assertEqualsIgnoreOrder(new TreePath[] {path2, path1}, tree.getSelectionPaths());
+        assertEqualsIgnoreOrder(new TreePath[] { path2, path1 }, tree.getSelectionPaths());
         assertEquals(1, tree.getMinSelectionRow());
         assertEquals(2, tree.getMaxSelectionRow());
-
         tree.expandPath(path1);
-        assertEqualsIgnoreOrder(new TreePath[] {path2, path1}, tree.getSelectionPaths());
+        assertEqualsIgnoreOrder(new TreePath[] { path2, path1 }, tree.getSelectionPaths());
         assertEquals(1, tree.getMinSelectionRow());
         assertEquals(3, tree.getMaxSelectionRow());
     }
@@ -1410,51 +1292,45 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
-
         root.add(child1);
         child1.add(child11);
         root.add(child2);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path2 = rootPath.pathByAddingChild(child2);
-
         assertEquals(rootPath, tree.getNextMatch("ro", 0, Position.Bias.Forward));
         assertEquals(rootPath, tree.getNextMatch("ro", 2, Position.Bias.Forward));
         assertEquals(rootPath, tree.getNextMatch("ro", 2, Position.Bias.Backward));
-
         assertEquals(path1, tree.getNextMatch("ch", 0, Position.Bias.Forward));
         assertEquals(path1, tree.getNextMatch("ch", 1, Position.Bias.Forward));
         assertEquals(path1, tree.getNextMatch("ch", 1, Position.Bias.Backward));
         assertEquals(path2, tree.getNextMatch("ch", 2, Position.Bias.Forward));
         assertEquals(path1, tree.getNextMatch("child1", 2, Position.Bias.Forward));
         assertEquals(path2, tree.getNextMatch("child2", 1, Position.Bias.Backward));
-
         assertNull(tree.getNextMatch("child11", 1, Position.Bias.Backward));
         tree.expandRow(1);
         assertEquals(path11, tree.getNextMatch("child11", 1, Position.Bias.Backward));
-
         assertEquals(path1, tree.getNextMatch("child1", 0, Position.Bias.Forward));
         assertEquals(path11, tree.getNextMatch("child1", 0, Position.Bias.Backward));
         assertEquals(path11, tree.getNextMatch("child1", 0, null));
         assertEquals(path11, tree.getNextMatch("ChiLD1", 0, null));
-
         assertNull(tree.getNextMatch("childX", 1, Position.Bias.Forward));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 tree.getNextMatch("any", -1, Position.Bias.Forward);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 tree.getNextMatch("any", 10, Position.Bias.Forward);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 tree.getNextMatch(null, 1, Position.Bias.Forward);
             }
@@ -1466,41 +1342,38 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
-
         root.add(child1);
         child1.add(child11);
         root.add(child2);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path2 = rootPath.pathByAddingChild(child2);
-
-        assertEquals(new TreePath[] {path1}, tree.getPathBetweenRows(1, 1));
-        assertEquals(new TreePath[] {rootPath, path1}, tree.getPathBetweenRows(0, 1));
-        assertEquals(new TreePath[] {path1, path2}, tree.getPathBetweenRows(1, 2));
-        assertEquals(new TreePath[] {rootPath, path1, path2}, tree.getPathBetweenRows(0, 2));
-
+        assertEquals(new TreePath[] { path1 }, tree.getPathBetweenRows(1, 1));
+        assertEquals(new TreePath[] { rootPath, path1 }, tree.getPathBetweenRows(0, 1));
+        assertEquals(new TreePath[] { path1, path2 }, tree.getPathBetweenRows(1, 2));
+        assertEquals(new TreePath[] { rootPath, path1, path2 }, tree.getPathBetweenRows(0, 2));
         if (isHarmony()) {
-            assertEquals(new TreePath[] {rootPath, path1, path2}, tree.getPathBetweenRows(-1, 3));
+            assertEquals(new TreePath[] { rootPath, path1, path2 }, tree.getPathBetweenRows(-1,
+                    3));
         } else {
-            assertEquals(new TreePath[] {null, rootPath, path1, path2, null}, tree.getPathBetweenRows(-1, 3));
+            assertEquals(new TreePath[] { null, rootPath, path1, path2, null }, tree
+                    .getPathBetweenRows(-1, 3));
         }
-
         tree.expandPath(path1);
-        assertEquals(new TreePath[] {rootPath, path1, path11}, tree.getPathBetweenRows(0, 2));
+        assertEquals(new TreePath[] { rootPath, path1, path11 }, tree.getPathBetweenRows(0, 2));
     }
 
     //This is UI behavior. Should not be deeply tested here
     public void testGetPathBounds() {
         Object root = tree.getModel().getRoot();
         TreePath pathToRoot = new TreePath(root);
-        assertEquals(tree.getPathBounds(pathToRoot), tree.getUI().getPathBounds(tree, pathToRoot));
-
+        assertEquals(tree.getPathBounds(pathToRoot), tree.getUI().getPathBounds(tree,
+                pathToRoot));
         TreePath pathToChild = pathToRoot.pathByAddingChild(tree.getModel().getChild(root, 0));
-        assertEquals(tree.getPathBounds(pathToChild), tree.getUI().getPathBounds(tree, pathToChild));
+        assertEquals(tree.getPathBounds(pathToChild), tree.getUI().getPathBounds(tree,
+                pathToChild));
     }
 
     //This is UI behavior. Should not be deeply tested here
@@ -1508,10 +1381,8 @@
         Object root = tree.getModel().getRoot();
         TreePath pathToRoot = new TreePath(root);
         assertEquals(tree.getRowBounds(0), tree.getUI().getPathBounds(tree, pathToRoot));
-
         TreePath pathToChild = pathToRoot.pathByAddingChild(tree.getModel().getChild(root, 0));
         assertEquals(tree.getRowBounds(1), tree.getUI().getPathBounds(tree, pathToChild));
-
         assertNull(tree.getRowBounds(-1));
         assertNull(tree.getRowBounds(10));
     }
@@ -1531,11 +1402,9 @@
         Object root = tree.getModel().getRoot();
         TreePath pathToRoot = new TreePath(root);
         assertEquals(0, tree.getRowForPath(pathToRoot));
-
         Object child = tree.getModel().getChild(root, 0);
         TreePath pathToChild = pathToRoot.pathByAddingChild(child);
         assertEquals(1, tree.getRowForPath(pathToChild));
-
         Object childChild = tree.getModel().getChild(child, 0);
         TreePath pathToChildChild = pathToChild.pathByAddingChild(childChild);
         assertEquals(-1, tree.getRowForPath(pathToChildChild));
@@ -1550,14 +1419,12 @@
 
     public void testGetRowCount() {
         assertEquals(4, tree.getRowCount());
-
         DefaultMutableTreeNode root = new DefaultMutableTreeNode("tree root");
         DefaultMutableTreeNode child = new DefaultMutableTreeNode("child");
         root.add(child);
         child.add(new DefaultMutableTreeNode("child_child"));
         tree.setModel(new DefaultTreeModel(root));
         assertEquals(2, tree.getRowCount());
-
         tree.setModel(null);
         assertEquals(0, tree.getRowCount());
     }
@@ -1567,7 +1434,6 @@
         tree.setRowHeight(20);
         assertEquals(20, tree.getRowHeight());
         assertTrue(propertyChangeController.isChanged("rowHeight"));
-
         propertyChangeController.reset();
         tree.setRowHeight(-10);
         assertEquals(-10, tree.getRowHeight());
@@ -1583,29 +1449,21 @@
 
     public void testGetSelectionCount() {
         assertEquals(0, tree.getSelectionCount());
-
         Object root = tree.getModel().getRoot();
         TreePath pathToRoot = new TreePath(root);
-
         Object child = tree.getModel().getChild(root, 0);
         TreePath pathToChild = pathToRoot.pathByAddingChild(child);
-
         Object childChild = tree.getModel().getChild(child, 0);
         TreePath pathToChildChild = pathToChild.pathByAddingChild(childChild);
-
         tree.addSelectionPath(pathToRoot);
         assertEquals(1, tree.getSelectionCount());
-
         tree.addSelectionPath(pathToChild);
         assertEquals(2, tree.getSelectionCount());
-
         tree.setExpandsSelectedPaths(false);
         tree.addSelectionPath(pathToChildChild);
         assertEquals(3, tree.getSelectionCount());
-
         tree.clearSelection();
         assertEquals(0, tree.getSelectionCount());
-
         tree.setAnchorSelectionPath(pathToChildChild);
         tree.setLeadSelectionPath(pathToRoot);
         assertEquals(0, tree.getSelectionCount());
@@ -1622,35 +1480,27 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
-
         assertNull(tree.getSelectionPaths());
         tree.setSelectionPath(path1);
         tree.addSelectionPath(rootPath);
-        assertEqualsIgnoreOrder(new TreePath[] {path1, rootPath}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path1, rootPath }, tree.getSelectionPaths());
         tree.setSelectionPath(path11);
-        assertEqualsIgnoreOrder(new TreePath[] {path11}, tree.getSelectionPaths());
-
-        tree.addSelectionPaths(new TreePath[] {rootPath, path111});
-        assertEqualsIgnoreOrder(new TreePath[] {path11, rootPath, path111}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { path11 }, tree.getSelectionPaths());
+        tree.addSelectionPaths(new TreePath[] { rootPath, path111 });
+        assertEqualsIgnoreOrder(new TreePath[] { path11, rootPath, path111 }, tree
+                .getSelectionPaths());
         tree.collapsePath(path1);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path1}, tree.getSelectionPaths());
-
-        tree.setSelectionPaths(new TreePath[] {path111});
-        assertEqualsIgnoreOrder(new TreePath[] {path111}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path1 }, tree.getSelectionPaths());
+        tree.setSelectionPaths(new TreePath[] { path111 });
+        assertEqualsIgnoreOrder(new TreePath[] { path111 }, tree.getSelectionPaths());
         tree.setSelectionPaths(null);
         assertNull(tree.getSelectionPaths());
     }
@@ -1675,7 +1525,6 @@
 
     public void testIsSetEditable() {
         assertFalse(tree.isEditable());
-
         tree.setEditable(true);
         assertTrue(tree.isEditable());
         assertTrue(propertyChangeController.isChanged("editable"));
@@ -1686,22 +1535,17 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
-
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(0));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(1));
-
         tree.expandPath(path1);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(0));
@@ -1741,10 +1585,8 @@
 
     public void testIsPathSelected() {
         TreePath unexistedPath = new TreePath(new DefaultMutableTreeNode("any root"));
-
         assertFalse(tree.isPathSelected(null));
         assertFalse(tree.isPathSelected(unexistedPath));
-
         tree.setSelectionPath(unexistedPath);
         assertTrue(tree.isPathSelected(unexistedPath));
     }
@@ -1752,17 +1594,14 @@
     public void testIsRowSelected() {
         assertFalse(tree.isRowSelected(0));
         assertFalse(tree.isRowSelected(10));
-
         tree.setSelectionRow(0);
         assertTrue(tree.isRowSelected(0));
     }
 
     public void testIsSelectionEmpty() {
         assertTrue(tree.isSelectionEmpty());
-
         tree.setSelectionRow(0);
         assertFalse(tree.isSelectionEmpty());
-
         tree.clearSelection();
         assertTrue(tree.isSelectionEmpty());
     }
@@ -1772,23 +1611,18 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
-
         assertTrue(tree.isVisible(rootPath));
         assertTrue(tree.isVisible(path1));
         assertFalse(tree.isVisible(path11));
         assertFalse(tree.isVisible(path111));
-
         tree.expandPath(path11);
         assertTrue(tree.isVisible(rootPath));
         assertTrue(tree.isVisible(path1));
@@ -1801,23 +1635,17 @@
         DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("child1");
         DefaultMutableTreeNode child11 = new DefaultMutableTreeNode("child11");
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path111 = path11.pathByAddingChild(child111);
-
         assertFalse(tree.isExpanded(path1));
-
         tree.makeVisible(path1);
         assertFalse(tree.isExpanded(path1));
-
         tree.makeVisible(path111);
         assertTrue(tree.isExpanded(path1));
         assertTrue(tree.isExpanded(path11));
@@ -1830,32 +1658,26 @@
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
         DefaultMutableTreeNode child21 = new DefaultMutableTreeNode("child21");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
         root.add(child2);
         child2.add(child21);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path21 = rootPath.pathByAddingChild(child21);
-
-        tree.setSelectionPaths(new TreePath[] {rootPath, path11, path21});
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path11, path21}, tree.getSelectionPaths());
-
+        tree.setSelectionPaths(new TreePath[] { rootPath, path11, path21 });
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path11, path21 }, tree
+                .getSelectionPaths());
         tree.removeDescendantSelectedPaths(path11, false);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path11, path21}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path11, path21 }, tree
+                .getSelectionPaths());
         tree.removeDescendantSelectedPaths(path11, true);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath, path21}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath, path21 }, tree.getSelectionPaths());
         tree.removeDescendantSelectedPaths(rootPath, false);
-        assertEqualsIgnoreOrder(new TreePath[] {rootPath}, tree.getSelectionPaths());
-
+        assertEqualsIgnoreOrder(new TreePath[] { rootPath }, tree.getSelectionPaths());
         tree.removeDescendantSelectedPaths(rootPath, true);
         if (isHarmony()) {
             assertEquals(0, tree.getSelectionPaths().length);
@@ -1871,40 +1693,37 @@
         DefaultMutableTreeNode child111 = new DefaultMutableTreeNode("child111");
         DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("child2");
         DefaultMutableTreeNode child21 = new DefaultMutableTreeNode("child21");
-
         root.add(child1);
         child1.add(child11);
         child11.add(child111);
         root.add(child2);
         child2.add(child21);
-
         tree.setModel(new DefaultTreeModel(root));
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(child1);
         TreePath path11 = path1.pathByAddingChild(child11);
         TreePath path2 = rootPath.pathByAddingChild(child2);
-
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path2));
-
         tree.expandPath(path1);
         tree.expandPath(path2);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertTrue(tree.isExpanded(path2));
-
-        tree.removeDescendantToggledPaths(createTestEnumeration(new TreePath[] {path2, path1}));
+        tree
+                .removeDescendantToggledPaths(createTestEnumeration(new TreePath[] { path2,
+                        path1 }));
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
         assertFalse(tree.isExpanded(path2));
-
         tree.expandPath(path11);
         tree.expandPath(path2);
-        tree.removeDescendantToggledPaths(createTestEnumeration(new TreePath[] {path2, path11}));
+        tree
+                .removeDescendantToggledPaths(createTestEnumeration(new TreePath[] { path2,
+                        path11 }));
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
@@ -1912,35 +1731,28 @@
     }
 
     public void testSetCellEditor() {
-        PropertyChangeController listener =  new PropertyChangeController();
-        DefaultTreeCellEditor editor1 = new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer)tree.getCellRenderer());
-        DefaultTreeCellEditor editor2 = new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer)tree.getCellRenderer());
-
+        PropertyChangeController listener = new PropertyChangeController();
+        DefaultTreeCellEditor editor1 = new DefaultTreeCellEditor(tree,
+                (DefaultTreeCellRenderer) tree.getCellRenderer());
+        DefaultTreeCellEditor editor2 = new DefaultTreeCellEditor(tree,
+                (DefaultTreeCellRenderer) tree.getCellRenderer());
         tree.addPropertyChangeListener(listener);
         TreeCellEditor oldEditor = tree.getCellEditor();
         tree.setCellEditor(editor1);
-        listener.checkPropertyFired(tree, "cellEditor",
-                                    oldEditor, editor1);
+        listener.checkPropertyFired(tree, "cellEditor", oldEditor, editor1);
         assertEquals("cellEditor", editor1, tree.getCellEditor());
-
         tree.setEditable(true);
         listener.reset();
-
         tree.setCellEditor(editor2);
-        listener.checkPropertyFired(tree, "cellEditor",
-                                    editor1, editor2);
+        listener.checkPropertyFired(tree, "cellEditor", editor1, editor2);
         assertEquals("cellEditor", editor2, tree.getCellEditor());
         assertTrue(tree.isEditable());
         listener.reset();
-
         tree.setCellEditor(editor2);
         assertFalse("event's not been fired ", listener.isChanged());
         listener.reset();
-
         tree.setCellEditor(null);
-        listener.checkPropertyFired(tree, "cellEditor",
-                                    editor2, null);
-
+        listener.checkPropertyFired(tree, "cellEditor", editor2, null);
         // it's being controlled by UI via listener
         assertNotNull("cellEditor", tree.getCellEditor());
         assertNotSame("cellEditor", oldEditor, tree.getCellEditor());
@@ -1954,32 +1766,24 @@
     }
 
     public void testSetCellRenderer() {
-        PropertyChangeController listener =  new PropertyChangeController();
+        PropertyChangeController listener = new PropertyChangeController();
         TreeCellRenderer renderer1 = new DefaultTreeCellRenderer();
         TreeCellRenderer renderer2 = new DefaultTreeCellRenderer();
-
         tree.addPropertyChangeListener(listener);
         TreeCellRenderer oldRenderer = tree.getCellRenderer();
         tree.setCellRenderer(renderer1);
-        listener.checkPropertyFired(tree, "cellRenderer",
-                                    oldRenderer, renderer1);
+        listener.checkPropertyFired(tree, "cellRenderer", oldRenderer, renderer1);
         assertEquals("cellRenderer", renderer1, tree.getCellRenderer());
         listener.reset();
-
         tree.setCellRenderer(renderer2);
-        listener.checkPropertyFired(tree, "cellRenderer",
-                                    renderer1, renderer2);
+        listener.checkPropertyFired(tree, "cellRenderer", renderer1, renderer2);
         assertEquals("cellRenderer", renderer2, tree.getCellRenderer());
         listener.reset();
-
         tree.setCellRenderer(renderer2);
         assertFalse("event's not been fired ", listener.isChanged());
         listener.reset();
-
         tree.setCellRenderer(null);
-        listener.checkPropertyFired(tree, "cellRenderer",
-                                    renderer2, null);
-
+        listener.checkPropertyFired(tree, "cellRenderer", renderer2, null);
         // it's being controlled by UI via listener
         assertNotNull("cellRenderer", tree.getCellRenderer());
         assertNotSame("cellRenderer", oldRenderer, tree.getCellRenderer());
@@ -2000,66 +1804,53 @@
         root.add(node1);
         node1.add(node11);
         node11.add(node111);
-
         DefaultTreeModel model = new DefaultTreeModel(root);
         tree.setModel(model);
-
         TreePath rootPath = new TreePath(root);
         TreePath path1 = rootPath.pathByAddingChild(node1);
         TreePath path11 = path1.pathByAddingChild(node11);
         TreePath path111 = path11.pathByAddingChild(node111);
-
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
-
         tree.setExpandedState(path1, true);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
-
         tree.setExpandedState(rootPath, false);
         assertFalse(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
-
         tree.setExpandedState(rootPath, true);
         assertTrue(tree.isExpanded(rootPath));
         assertTrue(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
-
         tree.setExpandedState(rootPath, false);
         assertFalse(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));
         assertFalse(tree.isExpanded(path11));
-
         tree.setExpandedState(path1, false);
         assertTrue(tree.isExpanded(rootPath));
         assertFalse(tree.isExpanded(path1));

[... 477 lines stripped ...]


Mime
View raw message