@Test
  public void clientTerminationWrapAndRecognizeTest() {
    Exception exception = new IOException("Connection reset by peer");
    assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));

    // Netty native IO exceptions should also be caught
    if (Epoll.isAvailable()) {
      exception = Errors.newIOException("method", Errors.ERRNO_ECONNRESET_NEGATIVE);
      assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));
    }

    exception = new IOException("Broken pipe");
    assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));

    exception = new IOException("Connection not reset by peer");
    assertFalse("Should not be declared as a client termination", Utils.isPossibleClientTermination(exception));
    exception = Utils.convertToClientTerminationException(exception);
    assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));

    exception = new Exception("Connection reset by peer");
    // debatable but this is the current implementation.
    assertFalse("Should not be declared as a client termination", Utils.isPossibleClientTermination(exception));
    exception = Utils.convertToClientTerminationException(exception);
    assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));

    exception = new SSLException("Handshake failure");
    assertFalse("Should not be declared as a client termination", Utils.isPossibleClientTermination(exception));
    exception = new SSLException("SSLEngine closed already");
    assertTrue("Should be declared as a client termination", Utils.isPossibleClientTermination(exception));
  }
Tests for {@link Utils#isPossibleClientTermination(Throwable)} and
{@link Utils#convertToClientTerminationException(Throwable)}.
ambry-utils/src/test/java/com/github/ambry/utils/UtilsTest.java