public T run() throws Exception {
    try {
      return execute();
    } catch(Exception e) {
      if (e.getClass().equals(retryExceptionType)){
        tries++;
        if (MAX_RETRIES == tries) {
          throw e;
        } else {
          return run();
        }
      } else {
        throw e;
      }
    }
  }
@Test
  public void testRetryFailure() {
    Retry<Void> retriable = new Retry<Void>(NullPointerException.class) {
      @Override
      public Void execute() {
        throw new RuntimeException();
      }
    };
    try {
      retriable.run();
      Assert.fail();
    } catch (Exception e) {
      Assert.assertEquals(RuntimeException.class, e.getClass());
    }
  }