code: public static <T> void forEachWithIndex(List<T> list, ObjectIntProcedure<? super T> objectIntProcedure)
      {
          int size = list.size();
          for (int i = 0; i < size; i++)
          {
              objectIntProcedure.value(list.get(i), i);
          }
      }
docs: Iterates over a collection passing each element and the current relative int index to the specified instance of
  ObjectIntProcedure.