@Test
public void testSendFailure() throws Exception {

  Destination corruptDestination = new TestDestination();
  Mutation<?> firstMutation = mock(Mutation.class);
  Mutation<?> secondMutation = mock(Mutation.class);
  when(keyProvider.get(firstMutation)).thenReturn("0");
  when(keyProvider.get(secondMutation)).thenReturn("1");
  Destination.Listener listener = mock(Destination.Listener.class);
  DestinationPool pool =
      new DestinationPool(
          keyProvider, Arrays.asList(mock(Destination.class), corruptDestination));
  pool.addListener(listener);
  pool.send(ImmutableList.of(firstMutation, secondMutation));
  verify(listener, times(1)).onError(any(RuntimeException.class));
}