コード例 #1
0
  @Test
  public void drop() {
    ArrayList<Integer> list = this.getIntegerList();
    ArrayList<Integer> results = ArrayListIterate.drop(list, 2);
    Assert.assertEquals(FastList.newListWith(3, 2, 1), results);

    Verify.assertSize(0, ArrayListIterate.drop(list, 5));
    Verify.assertSize(0, ArrayListIterate.drop(list, 6));
    Verify.assertSize(5, ArrayListIterate.drop(list, 0));

    Verify.assertSize(0, ArrayListIterate.drop(new ArrayList<Integer>(), 2));
  }
コード例 #2
0
 @Test(expected = IllegalArgumentException.class)
 public void drop_throws() {
   ArrayListIterate.drop(this.getIntegerList(), -1);
 }