docs: private Map<String, Reference> getReferences(ReadGroupSet readGroupSet) 
        throws IOException, GeneralSecurityException {
      Set<String> referenceSetIds = Sets.newHashSet();
      if (!Strings.isNullOrEmpty(readGroupSet.getReferenceSetId())) {
        LOG.info("Found reference set from read group set " + 
            readGroupSet.getReferenceSetId());
        referenceSetIds.add(readGroupSet.getReferenceSetId());
      }
      if (readGroupSet.getReadGroupsCount() > 0) {
        LOG.info("Found read groups");
        for (ReadGroup readGroup : readGroupSet.getReadGroupsList()) {
          if (!Strings.isNullOrEmpty(readGroup.getReferenceSetId())) {
            LOG.info("Found reference set from read group: " + 
                readGroup.getReferenceSetId());
            referenceSetIds.add(readGroup.getReferenceSetId());
          }
        }
      }
      
      ReferenceServiceV1BlockingStub referenceSetStub = 
          ReferenceServiceV1Grpc.newBlockingStub(getChannel());
          
      Map<String, Reference> references = Maps.newHashMap();
      for (String referenceSetId : referenceSetIds) {
        LOG.info("Getting reference set " + referenceSetId);
        GetReferenceSetRequest getReferenceSetRequest = GetReferenceSetRequest
            .newBuilder().setReferenceSetId(referenceSetId).build();
        ReferenceSet referenceSet = 
            referenceSetStub.getReferenceSet(getReferenceSetRequest);
        if (referenceSet == null || referenceSet.getReferenceIdsCount() == 0) {
          continue;
        }
        for (String referenceId : referenceSet.getReferenceIdsList()) {
          LOG.fine("Getting reference  " + referenceId);
          GetReferenceRequest getReferenceRequest = GetReferenceRequest
              .newBuilder().setReferenceId(referenceId).build();
          Reference reference = referenceSetStub.getReference(getReferenceRequest);
          if (!Strings.isNullOrEmpty(reference.getName())) {
            references.put(reference.getName(), reference);
            LOG.fine("Adding reference  " + reference.getName());
          }
        }
      }
      return references;
    }