private void add() {
    Object objBefore = list.getElementData();
    insert(7);
    Object objAfter = list.getElementData();
    assertSame("Before: " + Arrays.asList((Object[]) objBefore) + " After:"
        + Arrays.asList((Object[]) objAfter), objBefore, objAfter);

    assertEquals(7, list.size());
    for (int i = 0; i < 7; i++) {
      assertEquals(i + 1, list.get(i));
    }
    list.add(8);
    objAfter = list.getElementData();
    assertNotSame("Before: " + Arrays.asList((Object[]) objBefore) + " After:"
        + Arrays.asList((Object[]) objAfter), objBefore, objAfter);

    assertEquals(8, list.size());
    for (int i = 0; i < 8; i++) {
      assertEquals(i + 1, list.get(i));
    }
  }
This tests concurrent modification of IndexElemArray and to make sure elementData and size are
updated atomically. Ticket# GEODE-106.
geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexElemArrayJUnitTest.java