### Question:
DefaultSendRequestContext implements ConversationContext.SendRequestContext<T> { @Override public <E extends Throwable> ConversationContext.SendRequestContext<T> onError(BiConsumer<T, E> errorConsumer) { if (this.errorConsumer != null) { throw new ConversationContext.PlcWiringException("can't handle multiple error consumers"); } this.errorConsumer = errorConsumer; return this; } DefaultSendRequestContext(Consumer<HandlerRegistration> finisher, T request, ConversationContext<T> context); protected  DefaultSendRequestContext(Deque<Either<Function<?, ?>, Predicate<?>>> commands, Duration timeout, Consumer<HandlerRegistration> finisher, Object request, ConversationContext<?> context, Class<?> expectClazz, Consumer<?> packetConsumer, Consumer<TimeoutException> onTimeoutConsumer, BiConsumer<?, ? extends Throwable> errorConsumer); @Override ConversationContext.SendRequestContext<T> expectResponse(Class<T> clazz, Duration timeout); @Override ConversationContext.SendRequestContext<T> check(Predicate<T> checker); @Override DefaultContextHandler handle(Consumer<T> packetConsumer); @Override ConversationContext.SendRequestContext<T> onTimeout(Consumer<TimeoutException> onTimeoutConsumer); @Override ConversationContext.SendRequestContext<T> onError(BiConsumer<T, E> errorConsumer); @Override ConversationContext.SendRequestContext<R> unwrap(Function<T, R> unwrapper); @Override ConversationContext.SendRequestContext<R> only(Class<R> clazz);  }### Answer:
@Test void onError() { SUT.onError((p, e) -> e.printStackTrace()); assertThat(SUT.commands, hasSize(0)); assertThat(SUT.errorConsumer, notNullValue()); assertThrows(ConversationContext.PlcWiringException.class, () -> SUT.onError((p, e) -> e.printStackTrace())); }