Example #1
0
 @Override
 public int lastIndexOf(T element, int end) {
   for (int i = Math.min(end, length() - 1); i >= 0; i--) {
     if (Objects.equals(get(i), element)) {
       return i;
     }
   }
   return -1;
 }
Example #2
0
 @Override
 public int indexOf(T element, int from) {
   for (int i = from; i < length(); i++) {
     if (Objects.equals(get(i), element)) {
       return i;
     }
   }
   return -1;
 }