public boolean isInRange(int idx) {
        return 0 <= idx && idx < data.size();
    }
@Test
    public void testRange() {
        assertTrue(l.isInRange(0));
        assertTrue(l.isInRange(1));
        assertTrue(l.isInRange(2));

        assertFalse(l.isInRange(-1));
        assertFalse(l.isInRange(3));
    }