@Test public void testEmpty() { RepeatedList<Integer> rl = new RepeatedList<>(7, 0); assertThat(rl.size(), equalTo(0)); try { rl.get(-1); fail("Should throw an exception!"); } catch(IndexOutOfBoundsException e) { /* expected */ } try { rl.get(0); fail("Should throw an exception!"); } catch(IndexOutOfBoundsException e) { /* expected */ } try { rl.get(1); fail("Should throw an exception!"); } catch(IndexOutOfBoundsException e) { /* expected */ } }