code: private static boolean isDpiSet(final Multimap<String, String> extraParams) {
          String searchKey = "FORMAT_OPTIONS";
          for (String key: extraParams.keys()) {
              if (key.equalsIgnoreCase(searchKey)) {
                  for (String value: extraParams.get(key)) {
                      if (value.toLowerCase().contains("dpi:")) {
                          return true;
                      }
                  }
              }
          }
          return false;
      }
docs: Checks if the DPI value is already set for GeoServer.