class AaiConnection {

    static String getRelatedToProperty(final Relationship relationship, final String propertyKey) {
        if (relationship != null && relationship.getRelatedToProperty() != null) {
            for (final RelatedToProperty relatedToProperty : relationship.getRelatedToProperty()) {
                if (propertyKey.equals(relatedToProperty.getPropertyKey())) {
                    return relatedToProperty.getPropertyValue();
                }
            }
        }

        return null;
    }

}