@Test
  public void testSearchAndUpdateCollectionHeap() {
    gcPrintUsed();
    int repeats = 1000; // five seconds.
    int length = 1000 * 1000;
    HugeArrayBuilder<MutableTypes> mtb = new HugeArrayBuilder<MutableTypes>() {
    };
    final List<MutableTypes> mts = new ArrayList<MutableTypes>();
    for (int i = 0; i < length; i++) {
      final MutableTypes bean = mtb.createBean();
      bean.setBoolean2(true);
      bean.setByte2((byte) 1);
      mts.add(bean);
    }

    gcPrintUsed();

    long start = System.nanoTime();
    for (int i = 0; i < repeats; i++) {
      for (MutableTypes mt : mts) {
        mt.setInt(mt.getInt() + 1);
      }
    }
    long time = System.nanoTime() - start;
    printUsed();
    System.out.printf("List<JavaBean>, update one field took an average %.1f ns.%n", (double) time / length / repeats);
  }