public static <T extends PipelineOptions> T validate(Class<T> klass, PipelineOptions options) {
    return validate(klass, options, false);
  }
@Test
  public void testWhenOneOfRequiredGroupIsSetIsValid() {
    GroupRequired groupRequired = PipelineOptionsFactory.as(GroupRequired.class);
    groupRequired.setFoo("foo");
    groupRequired.setBar(null);
    groupRequired.setRunner(CrashingRunner.class);

    PipelineOptionsValidator.validate(GroupRequired.class, groupRequired);

    // Symmetric
    groupRequired.setFoo(null);
    groupRequired.setBar("bar");
    PipelineOptionsValidator.validate(GroupRequired.class, groupRequired);
  }