@Test
public void testLoad() throws Exception
{

   try
   {
      list.load(-1, 5);
      fail("An IllegalArgumentException is expected");
   }
   catch (IllegalArgumentException e)
   {
      // ok
   }
   try
   {
      list.load(0, -1);
      fail("An IllegalArgumentException is expected");
   }
   catch (IllegalArgumentException e)
   {
      // ok
   }
   try
   {
      list.load(0, 6);
      fail("An IllegalArgumentException is expected");
   }
   catch (IllegalArgumentException e)
   {
      // ok
   }
   try
   {
      list.load(1, 5);
      fail("An IllegalArgumentException is expected");
   }
   catch (IllegalArgumentException e)
   {
      // ok
   }
   // Length == size
   User[] users = list.load(0, 5);
   assertNotNull(users);
   assertEquals(5, users.length);
   int startIndex = 1;
   for (User user : users)
   {
      assertNotNull(user);
      assertEquals("foo" + startIndex++, user.getUserName());
   }
   // Length < size
   users = list.load(0, 3);
   assertNotNull(users);
   assertEquals(3, users.length);
   startIndex = 1;
   for (User user : users)
   {
      assertNotNull(user);
      assertEquals("foo" + startIndex++, user.getUserName());
   }
   // Length < size and index > 0
   users = list.load(2, 3);
   assertNotNull(users);
   assertEquals(3, users.length);
   startIndex = 3;
   for (User user : users)
   {
      assertNotNull(user);
      assertEquals("foo" + startIndex++, user.getUserName());
   }
}