code: private void updateEgoNetwork(final Node user) {
  		Node followedReplica, followingUser, lastPosterReplica;
  		Node prevReplica, nextReplica;
  
  		// loop through users following
  		for (Relationship relationship : user.getRelationships(
  				SocialGraphRelationshipType.REPLICA, Direction.INCOMING)) {
  			// load each replica and the user corresponding
  			followedReplica = relationship.getStartNode();
  			followingUser = NeoUtils.getPrevSingleNode(followedReplica,
  					SocialGraphRelationshipType.FOLLOW);
  
  			// bridge user node
  			prevReplica = NeoUtils.getPrevSingleNode(followedReplica,
  					SocialGraphRelationshipType.GRAPHITY);
  			if (!prevReplica.equals(followingUser)) {
  				followedReplica.getSingleRelationship(
  						SocialGraphRelationshipType.GRAPHITY,
  						Direction.INCOMING).delete();
  
  				nextReplica = NeoUtils.getNextSingleNode(followedReplica,
  						SocialGraphRelationshipType.GRAPHITY);
  				if (nextReplica != null) {
  					followedReplica.getSingleRelationship(
  							SocialGraphRelationshipType.GRAPHITY,
  							Direction.OUTGOING).delete();
  					prevReplica.createRelationshipTo(nextReplica,
  							SocialGraphRelationshipType.GRAPHITY);
  				}
  			}
  
  			// insert user's replica at its new position
  			lastPosterReplica = NeoUtils.getNextSingleNode(followingUser,
  					SocialGraphRelationshipType.GRAPHITY);
  			if (!lastPosterReplica.equals(followedReplica)) {
  				followingUser.getSingleRelationship(
  						SocialGraphRelationshipType.GRAPHITY,
  						Direction.OUTGOING).delete();
  				followingUser.createRelationshipTo(followedReplica,
  						SocialGraphRelationshipType.GRAPHITY);
  				followedReplica.createRelationshipTo(lastPosterReplica,
  						SocialGraphRelationshipType.GRAPHITY);
  			}
  		}
  	}
docs: update the ego network of a user
  
  @param user
  user where changes have occurred