docs: private static int indexOf(Object o, Object[] elements,
                                 int index, int fence) {
          if (o == null) {
              for (int i = index; i < fence; i++)
                  if (elements[i] == null)
                      return i;
          } else {
              for (int i = index; i < fence; i++)
                  if (o.equals(elements[i]))
                      return i;
          }
          return -1;
      }