public Helmert getWGS84Transformation(GeographicCRS sourceCRS) {
    if (sourceCRS == null) {
      return null;
    }
    if (LOG.isDebug()) {
      LOG.logDebug(
          "Searching for wgs84 transformation for given sourceCRS: "
              + Arrays.toString(sourceCRS.getIdentifiers()));
    }
    Helmert result = cachedWGS84Transformations.get(sourceCRS);
    if (result == null) {
      Transformation parsedTransformation = getTransformation(sourceCRS, null);
      if (parsedTransformation instanceof Helmert) {
        LOG.logDebug(
            "Found an helmert transformation for sourceCRS: "
                + Arrays.toString(sourceCRS.getIdentifiers()));
        result = (Helmert) parsedTransformation;
      } else {
        if (parsedTransformation instanceof CRSTransformation) {
          CoordinateSystem target = ((CRSTransformation) parsedTransformation).getTargetCRS();
          GeographicCRS t = null;
          if (LOG.isDebug()) {
            LOG.logDebug(
                "Found crstransformation for sourceCRS: "
                    + Arrays.toString(sourceCRS.getIdentifiers())
                    + " and targetCRS: "
                    + Arrays.toString(target.getIdentifiers())
                    + " will now use the targetCRS to find a Helmert transformation.");
          }
          if (target.getType() == CoordinateSystem.COMPOUND_CRS) {
            if (((CompoundCRS) target).getUnderlyingCRS().getType()
                == CoordinateSystem.PROJECTED_CRS) {
              t = ((ProjectedCRS) ((CompoundCRS) target).getUnderlyingCRS()).getGeographicCRS();
            } else if (((CompoundCRS) target).getUnderlyingCRS().getType()
                == CoordinateSystem.GEOGRAPHIC_CRS) {
              t = (GeographicCRS) target;
            } else {
              LOG.logWarning(
                  "Wgs84 Transformation lookup is currently only supported for GeographicCRS-chains.");
            }
          } else if (target.getType() == CoordinateSystem.PROJECTED_CRS) {
            t = ((ProjectedCRS) target).getGeographicCRS();
          } else if (target.getType() == CoordinateSystem.GEOGRAPHIC_CRS) {
            t = (GeographicCRS) target;
          } else {
            LOG.logWarning(
                "Wgs84 Transformation lookup is currently only supported for GeographicCRS-chains.");
          }
          if (t != null) {
            if (LOG.isDebug()) {
              LOG.logDebug(
                  "Trying to resolve target to find a wgs84transformation for the 'targetCRS': "
                      + Arrays.toString(t.getIdentifiers()));
            }
            result = getWGS84Transformation(t);
          }
        } else {
          LOG.logWarning(
              "The transformation is not an instance of CRSTransformation nor a Helmert, ignoring it.");
        }
      }
    }

    if (result != null) {
      if (LOG.isDebug()) {
        LOG.logDebug(
            "For the given crs: "
                + sourceCRS.getIdentifier()
                + " following helmert transformation was found:\n"
                + result);
      }

      cachedWGS84Transformations.put(sourceCRS, result);
    } else {
      LOG.logInfo(
          "No helmert transformation found for the given crs: " + sourceCRS.getIdentifier());
    }
    return result;
  }