@Test
public void batcher_passes_exceptions_up() throws Exception {

  Function<List<Integer>, List<Integer>> batchHandler = l -> {
    throw new RuntimeException("exception message");
  };
  try (MessageBatcher<Integer, Integer> batcher = new MessageBatcher<>(5, 2, EnqueueBehaviour.COMPLETE_EXCEPTIONALLY,
      batchHandler)) {
    batcher.apply(1).get();
    fail("Shouldn't get here");
  } catch (ExecutionException e) {
    assertThat(e.getCause(), instanceOf(RuntimeException.class));
    assertThat(e.getCause().getMessage(), is("exception message"));
  }
}