### Question:
FactPartitionBasedQueryCostCalculator implements QueryCostCalculator { @Override public QueryCost calculateCost(final AbstractQueryContext queryContext, LensDriver driver) throws LensException { Double cost = getTotalPartitionCost(queryContext, driver); QueryCost queryCost = cost == null ? null : new FactPartitionBasedQueryCost(cost); if (queryCost != null) { queryCost.setQueryCostType(queryCostTypeDecider.decideCostType(queryCost)); } return queryCost; }  @Override void init(LensDriver lensDriver); @Override QueryCost calculateCost(final AbstractQueryContext queryContext, LensDriver driver); Map<String, Set<?>> getAllPartitions(AbstractQueryContext queryContext, LensDriver driver); static final String UPDATE_PERIOD_WEIGHT_PREFIX; }### Answer:
@Test public void testCalculateCost() throws Exception { QueryCost cost = calculator.calculateCost(queryContext, driver); assertTrue(cost.getEstimatedResourceUsage() > 19.0, "Estimated resource usage:" + cost.getEstimatedResourceUsage()); assertTrue(cost.getEstimatedResourceUsage() < 20.0, "Estimated resource usage:" + cost.getEstimatedResourceUsage()); }