void (int key) { int index = getArrayIndex(key); MapEntry<T> candidate = myArray[index]; MapEntry<T> prev = null; while (candidate != null) { if (candidate.key == key) { if (prev == null) { myArray[index] = candidate.next; } else { prev.next = candidate.next; } candidate.before.after = candidate.after; candidate.after.before = candidate.before; candidate.next = candidate.before = candidate.after = null; mySize--; return; } prev = candidate; candidate = candidate.next; } }