class ReferringCodeGenerator {

    String generateReferringBody(ReferMetadata referMetadata) {
        Type referType = referMetadata.getRefType();
        String ref = referMetadata.getRef();
        return isCollection(referType)
                ? generateLoop(getCollectionGeneric(referType).getTypeName(), ref)
                : generateAssignment(getRawType(referType).getTypeName(), ref);
    }

}