@Test
public void testCopyTo() {

    Series<String> s = new OffsetLeadSeries<>(Series.forData("a", "b", "c", "d"), 1, "X");
    Object[] b1 = new Object[5];
    s.copyTo(b1, 0, 1, 4);
    assertArrayEquals(new Object[]{null, "X", "a", "b", "c"}, b1);
    Object[] b2 = new Object[5];
    s.copyTo(b2, 1, 1, 3);
    assertArrayEquals(new Object[]{null, "a", "b", "c", null}, b2);
    Object[] b3 = new Object[5];
    s.copyTo(b3, 3, 1, 1);
    assertArrayEquals(new Object[]{null, "c", null, null, null}, b3);
    Object[] b4 = new Object[5];
    s.copyTo(b4, 0, 1, 1);
    assertArrayEquals(new Object[]{null, "X", null, null, null}, b4);
}