code: public static Node getPrevSingleNode(final Node user,
  			RelationshipType relationshipType) {
  		// find an incoming relation of the type specified
  		final Relationship rel = user.getSingleRelationship(relationshipType,
  				Direction.INCOMING);
  
  		return (rel == null) ? (null) : (rel.getStartNode());
  	}
docs: find an incoming relation from the user passed of the specified type
  
  @param user
  destination user node
  @param relationshipType
  relationship type of the relation being searched
  @return source node of the relation<br>
  null - if there is no relation of the type specified