public static <T extends PipelineOptions> T as(Class<T> klass) {
    return new Builder().as(klass);
  }
@Test
  public void testGettersAnnotatedWithInconsistentJsonIgnoreValue() throws Exception {
    // Initial construction is valid.
    GetterWithJsonIgnore options = PipelineOptionsFactory.as(GetterWithJsonIgnore.class);

    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage(
        "Property [object] is marked with contradictory annotations. Found ["
            + "[JsonIgnore(value=false) on org.apache.beam.sdk.options.PipelineOptionsFactoryTest"
            + "$GetterWithInconsistentJsonIgnoreValue#getObject()], "
            + "[JsonIgnore(value=true) on org.apache.beam.sdk.options.PipelineOptionsFactoryTest"
            + "$GetterWithJsonIgnore#getObject()]].");

    // When we attempt to convert, we should error at this moment.
    options.as(GetterWithInconsistentJsonIgnoreValue.class);
  }