@Override
    public Object[] toArray() {
        return underlying.toArray();
    }
@Test
    public void testToArray() {
        BoundedList<Integer> list = BoundedList.newArrayBacked(3);
        list.add(1);
        list.add(2);
        list.add(3);
        assertArrayEquals(new Integer[] {1, 2, 3}, list.toArray());
        assertArrayEquals(new Integer[] {1, 2, 3}, list.toArray(new Integer[3]));
    }