class AaiConnection {

    static String getRelationshipData(final Relationship relationship, final String relationshipDataKey) {
        if (relationship != null && relationship.getRelationshipData() != null) {
            for (final RelationshipData relationshipData : relationship.getRelationshipData()) {
                if (relationshipDataKey.equals(relationshipData.getRelationshipKey())) {
                    return relationshipData.getRelationshipValue();
                }
            }
        }

        return null;
    }

}