@CanIgnoreReturnValue
  public GsonBuilder setVersion(double version) {
    if (Double.isNaN(version) || version < 0.0) {
      throw new IllegalArgumentException("Invalid version: " + version);
    }
    excluder = excluder.withVersion(version);
    return this;
  }
@Test
  public void testSetVersionInvalid() {
    GsonBuilder builder = new GsonBuilder();
    var e = assertThrows(IllegalArgumentException.class, () -> builder.setVersion(Double.NaN));
    assertThat(e).hasMessageThat().isEqualTo("Invalid version: NaN");

    e = assertThrows(IllegalArgumentException.class, () -> builder.setVersion(-0.1));
    assertThat(e).hasMessageThat().isEqualTo("Invalid version: -0.1");
  }