| 243 | } |
| 244 | |
| 245 | private class MyIterator implements Iterator<Entry<K, V>> { |
| 246 | private LinkedKey<K> current = first; |
| 247 | |
| 248 | public Entry<K, V> next() { |
| 249 | if (!hasNext()) { |
| 250 | throw new NoSuchElementException(); |
| 251 | } |
| 252 | Entry<K, V> result = find(current.key); |
| 253 | current = current.next; |
| 254 | return result; |
| 255 | } |
| 256 | |
| 257 | public boolean hasNext() { |
| 258 | return current != null; |
| 259 | } |
| 260 | |
| 261 | public void remove() { |
| 262 | LinkedHashMap.this.remove(current == null ? |
| 263 | last.key : current.previous.key); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 |
nothing calls this directly
no outgoing calls
no test coverage detected