void (String name, String value) { if (!isValidConstraintName(name)) { throw new IllegalArgumentException("Invalid constraint name"); } if (additionalConstraints == null) { if (value == null) { return; } additionalConstraints = new HashMap<>(); } if (value == null) { additionalConstraints.remove(name); if (additionalConstraints.isEmpty()) { additionalConstraints = null; } } else { additionalConstraints.put(name, value); } }