code: @Override
      public List<Metric> transform(QueryContext context, List<Metric> metrics) {
          SystemAssert.requireArgument(metrics != null, "Cannot transform null metric/metrics");
  
          List<Metric> result = new ArrayList<>(metrics.size());
  
          for (Metric metric : metrics) {
              Map<Long, Double> sortedDatapoints = new TreeMap<>();
              Double prevSum = 0.0;
  
              sortedDatapoints.putAll(metric.getDatapoints());
              for (Entry<Long, Double> entry : sortedDatapoints.entrySet()) {
                  prevSum += entry.getValue();
                  sortedDatapoints.put(entry.getKey(), prevSum);
              }
              metric.setDatapoints(sortedDatapoints);
              result.add(metric);
          }
          return result;
      }
docs: ~ Methods **************************************************************************************************************************************