code: public static List<NginxMetrics> findMetrics(List<String> metricsNames) {
          if (metricsNames == null || metricsNames.isEmpty()) {
              return Collections.singletonList(NginxMetrics.HANDLED);
          }
          final List<NginxMetrics> result = new ArrayList<>(metricsNames.size());
          for (NginxMetrics metric : getMetricsOfType(NginxMetrics.class)) {
              if (metricsNames.contains(metric.getCaption())) {
                  result.add(metric);
                  continue;
              }
              //we need 'handled' to monitor nginx restarts.
              if (metric == NginxMetrics.HANDLED) {
                  result.add(metric);
              }
          }
          return result;
      }
docs: Get NginxMetrics by their names. Order of NginxMetrics in the resulting list
  is constant and does not depend on order of metric names.
  {@link #HANDLED} is added to the result even if its name is not passed.
  @param metricsNames names of metrics.
  @return list of metrics found.