public static <T extends PipelineOptions> T validateCli(Class<T> klass, PipelineOptions options) {
    return validate(klass, options, true);
  }
@Test
  public void testWhenRequiredOptionIsSetAndClearedCli() {
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage(
        "Missing required value for " + "[--object, \"Fake Description\"].");

    Required required =
        PipelineOptionsFactory.fromArgs(new String[] {"--object=blah"}).as(Required.class);
    required.setObject(null);
    PipelineOptionsValidator.validateCli(Required.class, required);
  }