@Test
public void hasherThrowsExceptionWhichIsPropogated() throws Exception {

  Supplier<Function<Integer, Integer>> hasherSupplier = () -> i -> {
    throw new RuntimeException(Integer.toString(i));
  };
  List<Function<Integer, Integer>> delegates = Arrays.asList(Function.identity());
  try (MessagePartitioner<Integer, Integer> partitioner = new MessagePartitioner<>(hasherSupplier, delegates)) {
    try {
      partitioner.apply(1);
      fail("Should throw exception before reaching this point");
    } catch (RuntimeException e) {
      assertThat(e.getMessage(), is("1"));
    }
  }
}