class DockerHelper {

  @SuppressWarnings("DefaultCharset")
  public String getContainerId() {
    try (BufferedReader br = new BufferedReader(new FileReader(cgroupPath))) {
      String line;
      while ((line = br.readLine()) != null) {
        if (line.length() > CONTAINER_ID_LENGTH) {
          return line.substring(line.length() - CONTAINER_ID_LENGTH);
        }
      }
    } catch (FileNotFoundException e) {
      logger.log(Level.WARNING, "Failed to read container id, cgroup file does not exist.");
    } catch (IOException e) {
      logger.log(Level.WARNING, "Unable to read container id: " + e.getMessage());
    }

    return "";
  }

    DockerHelper();
  @VisibleForTesting  DockerHelper(String cgroupPath);

}