(List<?> list, @Nullable Object element)
| 1124 | } |
| 1125 | |
| 1126 | private static int lastIndexOfRandomAccess(List<?> list, @Nullable Object element) { |
| 1127 | if (element == null) { |
| 1128 | for (int i = list.size() - 1; i >= 0; i--) { |
| 1129 | if (list.get(i) == null) { |
| 1130 | return i; |
| 1131 | } |
| 1132 | } |
| 1133 | } else { |
| 1134 | for (int i = list.size() - 1; i >= 0; i--) { |
| 1135 | if (element.equals(list.get(i))) { |
| 1136 | return i; |
| 1137 | } |
| 1138 | } |
| 1139 | } |
| 1140 | return -1; |
| 1141 | } |
| 1142 | |
| 1143 | /** |
| 1144 | * Returns an implementation of {@link List#listIterator(int)}. |
no test coverage detected