private MetricValues metricValues(Set<MachineMetric> customSet,
            List<MachineMetric> defaults, List<Long> values) {
        List<MachineMetric> actualMetrics = defaults;
        List<Long> actualValues = values;
        if (customSet.size() > 0) {
            // custom set of machine metrics specified
            actualMetrics = new ArrayList<MachineMetric>();
            actualValues = new ArrayList<Long>();
            for (int i=0; i < defaults.size(); i++) {
                MachineMetric mm = defaults.get(i);
                if (customSet.contains(mm)) {
                    actualMetrics.add(mm);
                    actualValues.add(values.get(i));
                }
            }
        }
        return new MetricValues(actualMetrics, actualValues);
    }
private MetricValues metricValues ( Set < MachineMetric > customSet , List < MachineMetric > defaults , List < Long > values ) { List < MachineMetric > actualMetrics = defaults ; List < Long > actualValues = values ; if ( customSet . size ( ) > 0 ) { actualMetrics = new ArrayList < MachineMetric > ( ) ; actualValues = new ArrayList < Long > ( ) ; for ( int i = 0 ; i < defaults . size ( ) ; i ++ ) { MachineMetric mm = defaults . get ( i ) ; if ( customSet . contains ( mm ) ) { actualMetrics . add ( mm ) ; actualValues . add ( values . get ( i ) ) ; } } } return new MetricValues ( actualMetrics , actualValues ) ; }
Returns a subset of the given list of metrics in "defaults" and the
corresponding value of each returned metric in the subset. Note if the
custom set is empty, the full set of default machine metrics and values
will be returned. (In particular, as in set theory, a set is a subset of
itself.)

@param customSet
custom machine metrics specified in the SDK metrics registry
@param defaults
the given default list of metrics
@param values
corresponding values of each metric in "defaults"