### Question:
PhysicalPlan extends TreeNode { public WhereClause getWhereClause() { return whereClause; } PhysicalPlan(String description, LogicalPlan logicalPlan); WhereClause getWhereClause(); Map<String, String> getColumnAliasMapping(); List<SelectItem> getSelectItems(); boolean validateLogicalPlan(); Color validateNode(TreeNode node); PhysicalPlan paginate(RangeNode<?> rangeNode); abstract List<String> getRangeCols(String table); abstract List<String> getQueryCols(String table); abstract RangeOperations<?> getRangeOperations(String table, String column); abstract boolean tableExists(String table); abstract boolean columnExists(String table, String column); abstract Map<String, Integer> getColumnTypeMap(String table); @Override Object clone(); boolean checkFilterNull(Comparator cmp, String value); boolean isFilterWithNull(FilterItem filterItem);  }### Answer:
@Test public void testForRange() { String sql = "SELECT column1 as rcol1, column2 as rcol2, column3, qcol1 as direct1 FROM myTable tbl where rcol1 > 10 and column2 < 30 or (column3 != 25 and direct1 = 30)"; LogicalPlan plan = getLogicalPlan(sql); DummyPhysicalPlan physicalPlan = new DummyPhysicalPlan("dummyPlan", plan); WhereClause actual = physicalPlan.getWhereClause(); WhereClause expected = buildRangeAndDirectWhereClause(); assertEquals(expected, actual); }
@Test public void testComplexRangeQuery(){ String sql = "SELECT column1 as rcol1, column2 as rcol2, column3, qcol1 as direct1 FROM myTable tbl where rcol1 > 10 and rcol1 < 25 and (column2 <= 30 and " + "column2 >= 20 and rcol2 != 25) or (column3 != 25 and direct1 < 30)"; LogicalPlan plan = getLogicalPlan(sql); DummyPhysicalPlan physicalPlan = new DummyPhysicalPlan("dummyPlan", plan); WhereClause actual = physicalPlan.getWhereClause(); WhereClause expected = buildComplexRangeQueryWhereClause(); assertEquals(expected, actual); }