code: public static <T> int indexOf(T[] array, T value) {
          for (int i = 0; i < array.length; i++) {
              if (array[i] == null) {
                  if (value == null) return i;
              } else {
                  if (value != null && array[i].equals(value)) return i;
              }
          }
          return -1;
      }
docs: Return first index of {@code value} in {@code array}, or {@code -1} if
  not found.