code: @VisibleForTesting
    static void getLocationsFromLink(List<String> possiblePaths, Path link) {
      try {
        Path resolvedLink = link.toRealPath();
        Path possibleBinDir = resolvedLink.getParent();
        // check if the parent is "bin", we actually depend on that for other resolution
        if (possibleBinDir != null && possibleBinDir.getFileName().toString().equals("bin")) {
          Path possibleCloudSdkHome = possibleBinDir.getParent();
          if (possibleCloudSdkHome != null && Files.exists(possibleCloudSdkHome)) {
            possiblePaths.add(possibleCloudSdkHome.toString());
          }
        }
      } catch (IOException ioe) {
        // intentionally ignore exception
        logger.log(Level.FINE, "Non-critical exception when searching for cloud-sdk", ioe);
      }
    }
docs: resolve symlinks to a path that could be the bin directory of the cloud sdk