@VisibleForTesting
  static boolean isBrokenPipe(IOException original) {
    Throwable exception = original;
    while (exception != null) {
      String message = exception.getMessage();
      if (message != null && message.toLowerCase(Locale.US).contains("broken pipe")) {
        return true;
      }

      exception = exception.getCause();
      if (exception == original) { // just in case if there's a circular chain
        return false;
      }
    }
    return false;
  }
@Test
  public void testIsBrokenPipe_nestedBrokenPipe() {
    IOException exception = new IOException(new SSLException(new SocketException("Broken pipe")));
    Assert.assertTrue(RegistryEndpointCaller.isBrokenPipe(exception));
  }