code: static int lastIndexOfImpl(List<?> list, @NullableDecl Object element) {
      if (list instanceof RandomAccess) {
        return lastIndexOfRandomAccess(list, element);
      } else {
        ListIterator<?> listIterator = list.listIterator(list.size());
        while (listIterator.hasPrevious()) {
          if (Objects.equal(element, listIterator.previous())) {
            return listIterator.nextIndex();
          }
        }
        return -1;
      }
    }
docs: An implementation of {@link List#lastIndexOf(Object)}.