@Override
  public int lastIndexOf(Object o) {
    if (o == null) {
      for (int i = mElements.length - 1; i >= 0; i--) {
        if (mElements[i] == null) {
          return i;
        }
      }
    } else {
      for (int i = mElements.length - 1; i >= 0; i--) {
        if (o.equals(mElements[i])) {
          return i;
        }
      }
    }
    return -1;
  }
@Test
  public void lookupWithDuplicationAndNull() {
    String[] array = new String[]{"a", "b", "a", null, "b", null};
    UnmodifiableArrayList<String> list = new UnmodifiableArrayList<>(array);
    List<String> arrAsList = Arrays.asList(array);
    for (int i = 0; i < array.length; i++) {
      String s = array[i];
      assertEquals(arrAsList.lastIndexOf(s), list.lastIndexOf(s));
    }
  }