private void validateEnvironmentVariableUniqueness(ErrorCollection errors, String location) { HashSet<String> keys = new HashSet<>(); for (CREnvironmentVariable var : environment_variables) { String error = var.validateNameUniqueness(keys); if (error != null) errors.addError(location, error); } }