question: @ 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 ; }
target:  If constants is not null, apply mapping transform to metrics list. Otherwise, apply reduce transform to metrics list