static <
          RequestT,
          ResponseT,
          CallerSetupTeardownT extends Caller<RequestT, ResponseT> & SetupTeardown>
      Call<RequestT, ResponseT> ofCallerAndSetupTeardown(
          CallerSetupTeardownT implementsCallerAndSetupTeardown, Coder<ResponseT> responseTCoder) {
    implementsCallerAndSetupTeardown =
        SerializableUtils.ensureSerializable(implementsCallerAndSetupTeardown);
    return new Call<>(
        Configuration.<RequestT, ResponseT>builder()
            .setCaller(implementsCallerAndSetupTeardown)
            .setResponseCoder(responseTCoder)
            .setSetupTeardown(implementsCallerAndSetupTeardown)
            .build());
  }
@Test
  public void givenSetupTeardownNotSerializable_throwsError() {
    assertThrows(
        IllegalArgumentException.class,
        () ->
            Call.ofCallerAndSetupTeardown(
                new UnSerializableCallerWithSetupTeardown(), NON_DETERMINISTIC_RESPONSE_CODER));
  }