@Test
public void takesOverSingleWeight() {

    Overlap instance = someOverlap();
    Overlaps overlaps = new Overlaps();
    Model model = () -> asSet(instance.getPattern());
    ViolationWeightFunction weightFunction = new AverageWeightFunction(w((v, os, m) -> 42.0));
    double weight = weightFunction.getWeight(instance, overlaps, model);
    assertThat(weight, is(42.0));
}