### Question:
TableStats { public int estimateTableCardinality(double selectivityFactor) { return (int)Math.ceil(totalTuples()*selectivityFactor); } TableStats(int tableid, int ioCostPerPage); static TableStats getTableStats(String tablename); static void setTableStats(String tablename, TableStats stats); static void setStatsMap(HashMap<String,TableStats> s); static Map<String, TableStats> getStatsMap(); static void computeStatistics(); double estimateScanCost(); int estimateTableCardinality(double selectivityFactor); double avgSelectivity(int field, Predicate.Op op); double estimateSelectivity(int field, Predicate.Op op, Field constant); int totalTuples();  }### Answer:
@Test public void estimateTableCardinalityTest() { TableStats s = new TableStats(this.tableId, IO_COST); Assert.assertEquals(306, s.estimateTableCardinality(0.3)); Assert.assertEquals(1020, s.estimateTableCardinality(1.0)); Assert.assertEquals(0, s.estimateTableCardinality(0.0)); }