FailedTestInfo () { myAllTests = new ArrayList<>(); collectTests(myAllTests, (TreeNode)myModel.getTreeView().getModel().getRoot()); myDefects = Filter.DEFECTIVE_LEAF.select(myAllTests); if (myDefects.isEmpty()) { return this; } final AbstractTestProxy selectedTest = myModel.getTreeView().getSelectedTest(); final int selectionIndex = myAllTests.indexOf(selectedTest); if (selectionIndex == -1) return this; final AbstractTestProxy defect = findNextDefect(selectionIndex); if (defect == null) return this; if (defect != selectedTest) { myDefect = defect; return this; } final int defectIndex = myDefects.indexOf(defect); if (defectIndex == -1 || defectIndex == getBoundIndex()) return this; myDefect = myDefects.get(nextIndex(defectIndex)); return this; }