test_class.file: outland-feature-java/src/test/java/outland/feature/OptionSelectorBoolTest.java
test_class.identifier: OptionSelectorBoolTest
test_case.body: @Test
    public void testSelectFair() {
  
      FeatureOption f = FeatureOption.newBuilder()
          .setKey("false").setValue("false").setWeight(5_000).build();
  
      FeatureOption t = FeatureOption.newBuilder()
          .setKey("true").setValue("true").setWeight(5_000).build();
  
      OptionCollection collection = OptionCollection.newBuilder()
          .setOption(OptionType.bool)
          .addItems(t)
          .addItems(f)
          .buildPartial();
  
      final Feature feature1 = Feature.newBuilder()
          .setOptions(collection).setStatus(Status.on)
          .build();
  
      OptionSelectorBool oe = new OptionSelectorBool();
      oe.selectBooleanOptions(
          feature1.getOptions(),
          feature1.getStatus(),
          new OptionSelectorWeighted(feature1.getOptions().getItemsList())
      );
  
      final int[] fCount = {0};
      final int[] tCount = {0};
  
      final int runs = 10000;
  
      IntStream.range(0, runs).forEach(
          i -> {
            @SuppressWarnings("unused")
            int noop = oe.selectBooleanOptions(
                feature1.getOptions(),
                feature1.getStatus(),
                new OptionSelectorWeighted(feature1.getOptions().getItemsList())
            ) ? tCount[0]++ : fCount[0]++;
          }
      );
  
      int tC = tCount[0];
      int fC = fCount[0];
  
      int nearestNth = runs / 10;
      int nearestRoundUp = nearestNth / 2;
  
      final int tr = (int) (nearestNth * Math.floor((tC + nearestRoundUp) / nearestNth));
      final int fr = (int) (nearestNth * Math.floor((fC + nearestRoundUp) / nearestNth));
  
      assertTrue(tr == fr && (tr + fr == runs));
    }
test_case.class_method_signature: OptionSelectorBoolTest.testSelectFair()
test_case.full_signature: @Test public void testSelectFair()
test_case.identifier: testSelectFair
test_case.invocations: build setWeight setValue setKey newBuilder build setWeight setValue setKey newBuilder buildPartial addItems addItems setOption newBuilder build setStatus setOptions newBuilder selectBooleanOptions getOptions getStatus getItemsList getOptions forEach range selectBooleanOptions getOptions getStatus getItemsList getOptions floor floor assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSelectFair()
focal_class.file: outland-feature-java/src/main/java/outland/feature/OptionSelectorBool.java
focal_class.identifier: OptionSelectorBool
focal_class.class_method_signature: OptionSelectorBool.selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_class.full_signature:  boolean selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_class.identifier: selectBooleanOptions
focal_class.parameters: (
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_class.return: boolean
focal_class.signature: boolean selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_method.body: boolean selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    ) {
      if (!options.getOption().equals(OptionType.bool)) {
        return false; // todo: throw this?
      }
  
      if (!state.equals(Status.on)) {
        return false; // todo: replace with a fallback when we add fallbacks for options
      }
  
      final List<FeatureOption> optionsList = options.getItemsList();
  
      if (optionsList.get(0).getWeight() == 0 && optionsList.get(1).getWeight() == 0) {
        // zero/missing weights treated as a plain toggle
        return state.equals(Status.on);
      }
  
      return Boolean.parseBoolean(optionSelectorWeighted.select().getValue());
    }
focal_method.class_method_signature: OptionSelectorBool.selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_method.full_signature:  boolean selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_method.identifier: selectBooleanOptions
focal_method.invocations: equals getOption equals getItemsList getWeight get getWeight get equals parseBoolean getValue select
focal_method.parameters: (
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )
focal_method.return: boolean
focal_method.signature: boolean selectBooleanOptions(
        OptionCollection options,
        Status state,
        OptionSelectorWeighted optionSelectorWeighted
    )