@Test
public void testRetryOtherThanRemoteException() throws Throwable {

  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
      Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(
          IOException.class, RETRY_FOREVER);
  UnreliableInterface unreliable = (UnreliableInterface)
      RetryProxy.create(UnreliableInterface.class, unreliableImpl,
          retryOtherThanRemoteException(TRY_ONCE_THEN_FAIL,
              exceptionToPolicyMap));
  // should retry with local IOException.
  unreliable.failsOnceWithIOException();
  try {
    // won't get retry on remote exception
    unreliable.failsOnceWithRemoteException();
    fail("Should fail");
  } catch (RemoteException e) {
    // expected
  }
}