test_class.declarator: context = new JUnitRuleMockery()
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final JUnitRuleMockery context = new JUnitRuleMockery();
test_class.type: JUnitRuleMockery
test_class.var_name: context
test_class.file: mubench/src/test/java/de/tu_darmstadt/stg/mudetect/ranking/WeightRankingStrategyTest.java
test_class.identifier: WeightRankingStrategyTest
test_case.body: @Test
      public void ranksViolations() {
          Overlap violation1 = someOverlap();
          Overlap violation2 = someOverlap();
  
          Overlaps overlaps = new Overlaps();
          overlaps.addViolation(violation1);
          overlaps.addViolation(violation2);
  
          Model model = context.mock(Model.class);
  
          ViolationWeightFunction weightFunction = context.mock(ViolationWeightFunction.class);
          context.checking(new Expectations() {{
              allowing(weightFunction).getWeight(violation1, overlaps, model); will(returnValue(0.5));
              allowing(weightFunction).getFormula(violation1, overlaps, model); will(returnValue("0.5"));
              allowing(weightFunction).getWeight(violation2, overlaps, model); will(returnValue(0.7));
              allowing(weightFunction).getFormula(violation2, overlaps, model); will(returnValue("0.7"));
          }});
  
          ViolationRankingStrategy strategy = new WeightRankingStrategy(weightFunction);
          final List<Violation> violations = strategy.rankViolations(overlaps, model);
  
          assertThat(violations, contains(
                  new Violation(violation2, 0.7, "0.7"),
                  new Violation(violation1, 0.5, "0.5")));
      }
test_case.class_method_signature: WeightRankingStrategyTest.ranksViolations()
test_case.full_signature: @Test public void ranksViolations()
test_case.identifier: ranksViolations
test_case.invocations: someOverlap someOverlap addViolation addViolation mock mock checking getWeight allowing will returnValue getFormula allowing will returnValue getWeight allowing will returnValue getFormula allowing will returnValue rankViolations assertThat contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void ranksViolations()
focal_class.declarator: VIOLATION_COMPARATOR = Comparator
              .comparingDouble(Violation::getConfidence).reversed()
              .thenComparing(v -> v.getLocation().getMethodSignature())
focal_class.modifier: private final
focal_class.original_string: private final Comparator<Violation> VIOLATION_COMPARATOR = Comparator
              .comparingDouble(Violation::getConfidence).reversed()
              .thenComparing(v -> v.getLocation().getMethodSignature());
focal_class.type: Comparator<Violation>
focal_class.var_name: VIOLATION_COMPARATOR
focal_class.declarator: weightFunction
focal_class.modifier: private
focal_class.original_string: private ViolationWeightFunction weightFunction;
focal_class.type: ViolationWeightFunction
focal_class.var_name: weightFunction
focal_class.file: mubench/src/main/java/de/tu_darmstadt/stg/mudetect/ranking/WeightRankingStrategy.java
focal_class.identifier: WeightRankingStrategy
focal_class.interfaces: implements ViolationRankingStrategy
focal_class.class_method_signature: WeightRankingStrategy.WeightRankingStrategy(ViolationWeightFunction weightFunction)
focal_class.full_signature: public  WeightRankingStrategy(ViolationWeightFunction weightFunction)
focal_class.identifier: WeightRankingStrategy
focal_class.modifiers: public
focal_class.parameters: (ViolationWeightFunction weightFunction)
focal_class.signature:  WeightRankingStrategy(ViolationWeightFunction weightFunction)
focal_class.class_method_signature: WeightRankingStrategy.rankViolations(Overlaps overlaps, Model model)
focal_class.full_signature: @Override public List<Violation> rankViolations(Overlaps overlaps, Model model)
focal_class.identifier: rankViolations
focal_class.modifiers: @Override public
focal_class.parameters: (Overlaps overlaps, Model model)
focal_class.return: List<Violation>
focal_class.signature: List<Violation> rankViolations(Overlaps overlaps, Model model)
focal_class.class_method_signature: WeightRankingStrategy.toList(PriorityQueue<Violation> violations)
focal_class.full_signature: private List<Violation> toList(PriorityQueue<Violation> violations)
focal_class.identifier: toList
focal_class.modifiers: private
focal_class.parameters: (PriorityQueue<Violation> violations)
focal_class.return: List<Violation>
focal_class.signature: List<Violation> toList(PriorityQueue<Violation> violations)
focal_method.body: @Override
      public List<Violation> rankViolations(Overlaps overlaps, Model model) {
          PriorityQueue<Violation> violations = new PriorityQueue<>(VIOLATION_COMPARATOR);
          for (Overlap violation : overlaps.getViolations()) {
              double confidence = weightFunction.getWeight(violation, overlaps, model);
              String confidenceString = weightFunction.getFormula(violation, overlaps, model);
              violations.add(new Violation(violation, confidence, confidenceString));
          }
          return toList(violations);
      }
focal_method.class_method_signature: WeightRankingStrategy.rankViolations(Overlaps overlaps, Model model)
focal_method.full_signature: @Override public List<Violation> rankViolations(Overlaps overlaps, Model model)
focal_method.identifier: rankViolations
focal_method.invocations: getViolations getWeight getFormula add toList
focal_method.modifiers: @Override public
focal_method.parameters: (Overlaps overlaps, Model model)
focal_method.return: List<Violation>
focal_method.signature: List<Violation> rankViolations(Overlaps overlaps, Model model)