@Test
public void validateFeatureThrowingStringMismatchedOptionIds() {

  OptionCollection.Builder existing = OptionCollection.newBuilder()
      .setOption(OptionType.string)
      .addItems(FeatureOption.newBuilder().setValue("red").setKey("opt-red").setWeight(3000).setId("r"))
      .addItems(FeatureOption.newBuilder().setValue("green").setKey("opt-green").setWeight(2000).setId("g"))
      .addItems(FeatureOption.newBuilder().setValue("blue").setKey("opt-blue").setWeight(5000).setId("b"));
  OptionCollection.Builder update = OptionCollection.newBuilder()
      .setOption(OptionType.string)
      .addItems(FeatureOption.newBuilder().setValue("red").setKey("opt-red").setWeight(3000).setId("r"))
      .addItems(FeatureOption.newBuilder().setValue("green").setKey("opt-green").setWeight(2000).setId("g"))
      .addItems(FeatureOption.newBuilder().setValue("blue").setKey("opt-blue").setWeight(5000).setId("b"))
      // option id y is not already existing
      .addItems(FeatureOption.newBuilder().setValue("yello").setKey("opt-yello").setWeight(5000).setId("y"))
      ;
  try {
    new FeatureValidator().validateOptionIdsForUpdate(existing.build(), update.build());
    fail();
  } catch (ServiceException e) {
    assertEquals(422, e.problem().status());
    assertSame("option_ids_mismatch", e.problem().title());
  }
}