コード例 #1
0
  @Override
  @Test
  public void indexOf() {
    super.indexOf();
    MutableList<String> list = new CompositeFastList<String>();
    list.addAll(FastList.newListWith("1", "2", "3", "4"));
    list.addAll(FastList.newListWith("3", "B", "3", "B"));
    list.addAll(FastList.newListWith("3", "B", "3", "X"));

    Assert.assertEquals(2, list.indexOf("3"));
    Assert.assertEquals(5, list.indexOf("B"));
    Assert.assertEquals(11, list.indexOf("X"));

    Assert.assertEquals(-1, list.indexOf("missing"));
  }
コード例 #2
0
  @Override
  @Test
  public void newListWithSize() {
    super.newListWithSize();

    MutableList<Integer> objects = ArrayListAdapter.<Integer>newList(4).with(1, 2, 3);
    Assert.assertEquals(1, objects.indexOf(2));
  }