### Question:
AbstractQueryContext implements Serializable { public void estimateCostForDrivers() throws LensException { Map<LensDriver, DriverEstimateRunnable> estimateRunnables = getDriverEstimateRunnables(); for (LensDriver driver : estimateRunnables.keySet()) { log.info("Running estimate for driver {}", driver); estimateRunnables.get(driver).run(); } } protected  AbstractQueryContext(final String query, final String user, final LensConf qconf, final Configuration conf,
    final Collection<LensDriver> drivers, boolean mergeDriverConf); protected  AbstractQueryContext(final String query, final String user, final LensConf qconf, final Configuration conf,
    final Collection<LensDriver> drivers, boolean mergeDriverConf, Set<String> userGroups); void initTransientState(); void setDriverQueries(Map<LensDriver, String> driverQueries); void estimateCostForDrivers(); Map<LensDriver, DriverEstimateRunnable> getDriverEstimateRunnables(); Map<String, Double> getTableWeights(LensDriver driver); DriverQueryPlan getDriverRewriterPlan(LensDriver driver); String getQueue(); String getSelectedDriverQuery(); String getDriverQuery(LensDriver driver); String getFinalDriverQuery(LensDriver driver); Configuration getDriverConf(LensDriver driver); QueryCost getDriverQueryCost(LensDriver driver); Configuration getSelectedDriverConf(); void setSelectedDriverQuery(String driverQuery); void setSelectedDriver(LensDriver driver); LensDriver getSelectedDriver(); DriverQueryPlan getSelectedDriverQueryPlan(); void setDriverRewriteError(LensDriver driver, Exception exp); Exception getDriverRewriteError(LensDriver driver); HiveConf getHiveConf(); void setFinalDriverQuery(LensDriver driver, String rewrittenQuery); void setDriverQuery(LensDriver driver, String query); void setDriverCost(LensDriver driver, QueryCost cost); abstract String getLogHandle(); String getDatabase(); void clearTransientStateAfterLaunch(); void clearTransientStateAfterCompleted(); void updateConf(Map<String, String> confoverlay);  }### Answer:
@Test public void testEstimateGauges() throws LensException { MockQueryContext ctx = new MockQueryContext(getConfiguration(QUERY_METRIC_UNIQUE_ID_CONF_KEY, TestAbstractQueryContext.class.getSimpleName())); ctx.estimateCostForDrivers(); MetricRegistry reg = LensMetricsRegistry.getStaticRegistry(); assertTrue(reg.getGauges().keySet().containsAll(Arrays.asList( "lens.MethodMetricGauge.TestAbstractQueryContext-"+new MockDriver().getFullyQualifiedName()+"-driverEstimate"))); }