@Override
    public double cost(Link link, ResourceContext context) {
        // explicitly call a method not depending on LinkResourceService
        return cost(link);
    }
@Test
    public void testValidCost() {
        TierConstraint constraint = new TierConstraint(true, TierConstraint.CostType.VALID, 2, 1);

        assertThat(constraint.cost(link1, resourceContext), is(1.0));
        assertThat(constraint.cost(link2, resourceContext), is(1.0));
        assertThat(constraint.cost(link3, resourceContext), is(-1.0));
    }