protected CSRelatedNodeWrapper findExistingRelatedNode ( final Relationship relationship , final List < CSRelatedNodeWrapper > topicRelatedNodes ) { if ( topicRelatedNodes != null ) { // Loop over the current nodes and see if any match for ( final CSRelatedNodeWrapper relatedNode : topicRelatedNodes ) { if ( relationship instanceof TargetRelationship ) { if ( doesRelationshipMatch ( ( TargetRelationship ) relationship , relatedNode ) ) { return relatedNode ; } } else { if ( doesRelationshipMatch ( ( TopicRelationship ) relationship , relatedNode ) ) { return relatedNode ; } } } } return null ; }
Finds an existing relationship for a topic .