int () { if (myCanExpand) { return allPaths().indexOf(Conditions.equalTo(myComponent.getSelectionPath())); } int[] selectionRows = myComponent.getSelectionRows(); return selectionRows == null || selectionRows.length == 0 ? -1 : selectionRows[0]; }