Boolean (final int rowIndex) { Boolean previousValue = null; final ExistedScopesStatesAndNonExistNames existedScopesStatesAndNonExistNames = getScopeToolState(rowIndex); for (final ScopeToolState scopeToolState : existedScopesStatesAndNonExistNames.getExistedStates()) { final boolean currentValue = scopeToolState.isEnabled(); if (previousValue == null) { previousValue = currentValue; } else if (!previousValue.equals(currentValue)){ return null; } } if (!existedScopesStatesAndNonExistNames.getNonExistNames().isEmpty() && !Boolean.FALSE.equals(previousValue)) { return null; } return previousValue; }