@Test public void asBiFunction() { Operation op = Operation.createGet(URI.create("/hello")); Throwable th = new Exception(); CompletionHandler h = (o, e) -> { assertSame(op, o); assertSame(th, e); }; BiFunction<Operation, Throwable, Void> func = OperationFutures.asFunc(h); func.apply(op, th); }
@Test public void asBiFunction() { Operation op = Operation.createGet(URI.create("/hello")); Throwable th = new Exception(); CompletionHandler h = (o, e) -> { assertSame(op, o); assertSame(th, e); }; BiFunction<Operation, Throwable, Void> func = OperationFutures.asFunc(h); func.apply(op, th); }