class OffsetLagSeries extends OffsetSeries<T> {

    @Override
    public void copyTo(Object[] to, int fromOffset, int toOffset, int len) {
        int size = size();

        if (fromOffset + len > size) {
            throw new ArrayIndexOutOfBoundsException(fromOffset + len);
        }

        int len1 = Math.min(size + offset - fromOffset, len);
        int len2 = len - len1;
        int off1 = fromOffset - offset;

        if (len1 > 0) {
            delegate.copyTo(to, off1, toOffset, len1);
        }

        if (len2 > 0) {
            Arrays.fill(to, toOffset + len1, toOffset + len, filler);
        }
    }

    public  OffsetLagSeries(Series<T> delegate, int offset, T filler);

}