ScopeToolState (final String keyName, final int rowIndex) { if (rowIndex == lastRowIndex()) { return myInspectionProfile.getToolDefaultState(keyName, myProject); } else { final String scopeName = myScopeNames[rowIndex]; final List<ScopeToolState> nonDefaultTools = myInspectionProfile.getNonDefaultTools(keyName, myProject); for (final ScopeToolState nonDefaultTool : nonDefaultTools) { if (Objects.equals(scopeName, nonDefaultTool.getScopeName())) { return nonDefaultTool; } } } return null; }