@Override
  public void onError(Throwable e)
  {
    // individual callbacks are notified first
    for (Callback<RestResponse> callback : _callbacks.values())
    {
      callback.onError(e);
    }
    // aggregated callback is guaranteed to be called after all individual callbacks
    _aggregatedCallback.onError(e);
  }
@Test
  public void testError() throws Exception
  {
    FutureCallback<RestResponse> callback1 = new FutureCallback<>();
    FutureCallback<RestResponse> callback2 = new FutureCallback<>();

    ImmutableMap<Integer, Callback<RestResponse>> individualCallbacks = ImmutableMap.<Integer, Callback<RestResponse>>of(ID1, callback1, ID2, callback2);
    FutureCallback<MultiplexedResponse> aggregatedCallback = new FutureCallback<>();

    MultiplexedCallback multiplexedCallback = new MultiplexedCallback(individualCallbacks, aggregatedCallback);
    RestLiDecodingException exception = new RestLiDecodingException(null, null);
    multiplexedCallback.onError(exception);

    Assert.assertSame(getError(callback1), exception);
    Assert.assertSame(getError(callback2), exception);
    Assert.assertSame(getError(aggregatedCallback), exception);
  }