@Test
  public void itUsesPassedServerOverloadedValue() {
    String exceptionClass = HBaseServerException.class.getName();
    String message = "server is overloaded";
    RemoteWithExtrasException ex =
      new RemoteWithExtrasException(exceptionClass, message, false, false);
    IOException result = ex.unwrapRemoteException();

    assertTrue(result instanceof HBaseServerException);
    assertFalse(((HBaseServerException) result).isServerOverloaded());

    // run again with true value passed in
    ex = new RemoteWithExtrasException(exceptionClass, message, false, true);
    result = ex.unwrapRemoteException();

    assertTrue(result instanceof HBaseServerException);
    // expect true this time
    assertTrue(((HBaseServerException) result).isServerOverloaded());
  }
test verifies that we honor the inherent value of an exception for isServerOverloaded. We don't
want a false value passed into RemoteWithExtrasExceptions to override the inherent value of an
exception if it's already true. This could be due to an out of date server not sending the
proto field we expect.
hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestRemoteWithExtrasException.java