public static <E> ArrayList<E> newArrayListWithCapacity(
      int initialArraySize) {
    checkNonnegative(initialArraySize, "initialArraySize");
    return new ArrayList<>(initialArraySize);
  }
@Test
  public void testArrayListWithSize() {
    List<String> list = Lists.newArrayListWithCapacity(3);
    list.add("record1");
    list.add("record2");
    list.add("record3");
    Assert.assertEquals(3, list.size());
    Assert.assertEquals("record1", list.get(0));
    Assert.assertEquals("record2", list.get(1));
    Assert.assertEquals("record3", list.get(2));
    list = Lists.newArrayListWithCapacity(3);
    list.add("record1");
    list.add("record2");
    list.add("record3");
    Assert.assertEquals(3, list.size());
    Assert.assertEquals("record1", list.get(0));
    Assert.assertEquals("record2", list.get(1));
    Assert.assertEquals("record3", list.get(2));
  }