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

    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("required value for group [both]");
    expectedException.expectMessage("properties [getBoth()]");

    PipelineOptionsValidator.validate(JoinedOptions.class, options);
  }