public static <T extends PipelineOptions> T as(Class<T> klass) {
    return new Builder().as(klass);
  }
@Test
  public void testGettersWithMultipleDefaults() throws Exception {
    expectedException.expect(IllegalArgumentException.class);

    // Make sure the error message says what the problem is, generally
    expectedException.expectMessage("contradictory annotations");

    // Make sure the error message gives actionable details about what annotations were
    // contradictory.
    // Note that the quotes in the unparsed string are present in Java 11 but absent in Java 8
    expectedException.expectMessage(
        anyOf(
            containsString("Default.String(value=\"abc\")"),
            containsString("Default.String(value=abc)")));
    expectedException.expectMessage("Default.Integer(value=0)");

    // When we attempt to create, we should error at this moment.
    PipelineOptionsFactory.as(GettersWithMultipleDefault.class);
  }