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

    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("Missing required value for group [ham]");
    expectedException.expectMessage("properties");
    expectedException.expectMessage("getFoo");
    expectedException.expectMessage("getBar");

    PipelineOptionsValidator.validate(GroupRequired.class, groupRequired);
  }