public static <T, R> void assertFutureEquals(final T expected, final Future<R> future,
            final Function<R, T> unwrapper, final int timeout, final TimeUnit timeoutUnit) {
        try {
            assertEquals(expected, unwrapper.apply(future.get(timeout, timeoutUnit)));
        } catch (InterruptedException | ExecutionException | TimeoutException e) {
            fail("Unexpected error while trying to get the result", e);
        }
    }
Asserts that the {@link Future} returns the expected result.

@param <T> The type of the unwrapped/expected content.
@param <R> The type of the future content.
@param expected The expected content.
@param future The future to check for the expected content.
@param unwrapper The function used to extract the content.
@param timeout The maximum time to wait for the result.
@param timeoutUnit The time unit of the {@code timeout} argument.
tests/src/test/java/net/devh/boot/grpc/test/util/FutureAssertions.java