code: private void convertIdtoLabelLabels(
        List<Object> idLabels, EntityType entityType, DataService dataService) {
      final int nrLabels = idLabels.size();
      if (nrLabels > 0) {
        // Get entities for ids
        // Use Iterables.transform to work around List<String> to Iterable<Object> cast error
        Stream<Object> idLabelsWithoutNull =
            idLabels
                .stream()
                .filter(Objects::nonNull)
                .map(
                    untypedIdLabel ->
                        EntityUtils.getTypedValue(
                            untypedIdLabel.toString(), entityType.getIdAttribute()));
  
        // Map entity ids to labels
        Map<String, Entity> idToLabelMap = new HashMap<>();
        dataService
            .findAll(entityType.getId(), idLabelsWithoutNull)
            .forEach(entity -> idToLabelMap.put(entity.getIdValue().toString(), entity));
  
        for (int i = 0; i < nrLabels; ++i) {
          Object id = idLabels.get(i);
          if (id != null) // missing value label
          {
            idLabels.set(i, idToLabelMap.get(id.toString()));
          }
        }
      }
    }
docs: Convert matrix labels that contain ids to label attribute values. Keeps in mind that the last
  label on a axis is "Total".