@Test public void testHead() throws Exception { List<String> mList = new ArrayList<>(); mList.add("x"); mList.add("y"); mList.add("z"); mList.add("w"); ImmutableList<String> l = new ArrayBackedImmutableList<String>(mList); Assert.assertEquals("[x]", l.head(1).toString()); Assert.assertEquals("[]", l.head(0).toString()); Assert.assertEquals("[x, y, z]", l.head(3).toString()); }