private <S> List<P> applyFilter(List<S> sourceList, Function<S, P> filter) {
        if (CollectionUtils.isEmpty(sourceList)) {
            return Collections.emptyList();
        }

        final List<P> result = new ArrayList<>(sourceList.size());
        for (S source : sourceList) {
            P apply = filter.apply(source);
            result.add(apply);
        }
        return result;
    }
@author HyunGil Jeong
@author minwoo.jung
web/src/main/java/com/navercorp/pinpoint/web/vo/chart/TimeSeriesChartBuilder.java