@Override
    public <T> T[] toArray(T[] a) {
        if (a.length < size) {
            @SuppressWarnings("unchecked")
            final T[] newArray = ((T[]) Array.newInstance(a.getClass().getComponentType(), size));
            copyOfTimeSeries(newArray);
            return newArray;
        }
        copyOfTimeSeries(a);
        return a;
    }
A virtual list that represents a time series.
@author emeroad
commons-timeseries/src/main/java/com/navercorp/pinpoint/common/timeseries/window/TimeSeriesVirtualList.java