cost.addCostSource(new GlobalCost(new SourceLocation(null, 0), null, Cost.global(1)));
MethodCost cost3 = new MethodCost("", "b", 0, false, false, false);
cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
cost.addCostSource(new MethodInvocationCost(new SourceLocation(null, 0), cost3,
IMPLICIT_STATIC_INIT, Cost.cyclomatic(3)));
CostModel costModel = new CostModel(2, 10, 1);
cost.link();
assertEquals((long) 2 * (3 + 1) + 10 * 1, costModel.computeOverall(cost.getTotalCost()));