final synchronized void setPredecessor(Node potentialPredecessor) {

		if (potentialPredecessor == null) {
			NullPointerException e = new NullPointerException(
					"Potential predecessor of method setPredecessor may not be "
							+ "null!");
			this.logger.error("Null pointer", e);
			throw e;
		}
		this.checkIfProxy(potentialPredecessor);

		boolean info = this.logger.isEnabledFor(INFO);
		if (!(potentialPredecessor.equals(this.predecessor))) {
			Node formerPredecessor = this.predecessor;
			this.predecessor = potentialPredecessor;
			if (formerPredecessor != null) {
				this.disconnectIfUnreferenced(formerPredecessor);
				/*
				 * The replicas, which are in the range between the old and the
				 * new predecessor, on the last successor of this node have to
				 * be removed if the successor list is full. => capacity of sl ==
				 * length of sl.
				 */
				int sLSize = this.successorList.getSize();
				if (this.successorList.getCapacity() == sLSize) {
					Node lastSuccessor = this.successorList.getReferences()
							.get(sLSize - 1);
					try {
						lastSuccessor.removeReplicas(this.predecessor
								.getNodeID(), new HashSet<Entry>());
					} catch (CommunicationException e) {
						logger
								.warn(
										"Could not remove replicas on last predecessor",
										e);
					}
				}
				if (this.logger.isEnabledFor(DEBUG)) {
					this.logger.debug("Old predecessor " + formerPredecessor
							+ " was replaced by " + potentialPredecessor);
				}
			} else {
				if (info) {
					this.logger.info("Predecessor reference set to "
							+ potentialPredecessor + "; was null before.");
				}
				Set<Entry> entriesToRep = this.entries.getEntriesInInterval(
						this.predecessor.getNodeID(), this.localID);
				List<Node> successors = this.successorList.getReferences();
				for (Node successor : successors) {
					try {
						successor.insertReplicas(entriesToRep);
					} catch (CommunicationException e) {
						this.logger.warn(
								"Damn. Could not replicate to successor "
										+ successor.getNodeID(), e);
					}
				}
			}
		}
	}