@Override public List<Metric> transform(List<Metric> metrics,List<String> constants){
  SystemAssert.requireArgument(metrics != null,"Metric List cannot be null");
  SystemAssert.requireArgument(constants != null && !constants.isEmpty(),"This Transform cannot be used without a constant");
  if (metrics.isEmpty()) {
    return metrics;
  }
  List<Metric> result=new ArrayList<Metric>();
  if (constants.size() == 1) {
    result=Arrays.asList(reduce(metrics,constants));
  }
 else   if (constants.size() > 1) {
    result=mapping(metrics,constants);
  }
  return result;
}

@ Override public List < Metric > transform ( List < Metric > metrics , List < String > constants ) { SystemAssert . requireArgument ( metrics != null , "Metric List cannot be null" ) ; SystemAssert . requireArgument ( constants != null && ! constants . isEmpty ( ) , "This Transform cannot be used without a constant" ) ; if ( metrics . isEmpty ( ) ) { return metrics ; } List < Metric > result = new ArrayList < Metric > ( ) ; if ( constants . size ( ) == 1 ) { result = Arrays . asList ( reduce ( metrics , constants ) ) ; } else if ( constants . size ( ) > 1 ) { result = mapping ( metrics , constants ) ; } return result ; }
if constants is not null , apply mapping transform to metrics list . otherwise , apply reduce transform to metrics list
