public static <T extends PipelineOptions> T validate(Class<T> klass, PipelineOptions options) {
    return validate(klass, options, false);
  }
@Test
  public void
      testSuperInterfaceGroupIsInAdditionToSubInterfaceGroupOnlyWhenValidatingSuperInterface() {
    SubOptions opts = PipelineOptionsFactory.as(SubOptions.class);
    opts.setFoo("Foo");
    opts.setSuperclassObj("Hello world");
    opts.setRunner(CrashingRunner.class);

    // Valid SubOptions, but invalid SuperOptions
    PipelineOptionsValidator.validate(SubOptions.class, opts);

    expectedException.expectMessage("sub");
    expectedException.expectMessage("Missing required value");
    expectedException.expectMessage("getBar");
    PipelineOptionsValidator.validate(SuperOptions.class, opts);
  }