  @Test
  public void testVerifyCaller() {

    class A implements Callable<Object> {
      @SuppressWarnings("unused")
      @Override public Object call() throws IOException, InterruptedException {
        return null;
      }
    }

    class B extends A {
    }

    class C extends A {
      @SuppressWarnings("unused")
      @Override public Object call() throws FileNotFoundException  {
        return null;
      }
    }

    class D extends C {
      @Override public Object call() throws IllegalArgumentException {
        return null;
      }
    }

    class E extends A {
      @Override public String call() throws NullPointerException {
        return null;
      }
    }

    class F extends A {
      @Override public Object call() throws Error {
        return null;
      }
    }

    ExceptionHandler handler = ExceptionHandler.getDefaultInstance();
    assertValidCallable(new A(), handler);
    assertValidCallable(new B(), handler);
    assertValidCallable(new C(), handler);
    assertValidCallable(new D(), handler);
    assertValidCallable(new E(), handler);
    assertInvalidCallable(new F(), handler);

    handler = new ExceptionHandler.Builder().retryOn(
        FileNotFoundException.class, NullPointerException.class).build();
    assertInvalidCallable(new A(), handler);
    assertInvalidCallable(new B(), handler);
    assertValidCallable(new C(), handler);
    assertInvalidCallable(new D(), handler);
    assertValidCallable(new E(), handler);
    assertInvalidCallable(new F(), handler);
  }