Object (@Nullable Map<String, Object> params, @NotNull String paramName, boolean required) { final Object value = params == null ? null : params.get(paramName); if (value == null && required) { throw new IllegalArgumentException("Parameter not found"); } return value; }