### Question:
FlinkCalciteCatalogReader extends CalciteCatalogReader { @Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } } FlinkCalciteCatalogReader(
		CalciteSchema rootSchema,
		List<List<String>> defaultSchemas,
		RelDataTypeFactory typeFactory,
		CalciteConnectionConfig config); @Override Prepare.PreparingTable getTable(List<String> names);  }### Answer:
@Test public void testGetFlinkTable() { FlinkTable flinkTableMock = mock(FlinkTable.class); when(flinkTableMock.getRowType(typeFactory)).thenReturn(mock(RelDataType.class)); rootSchemaPlus.add(tableMockName, flinkTableMock); Prepare.PreparingTable resultTable = catalogReader.getTable(Arrays.asList(tableMockName)); assertTrue(resultTable instanceof FlinkRelOptTable); }
@Test public void testGetNonFlinkTable() { Table nonFlinkTableMock = mock(Table.class); when(nonFlinkTableMock.getRowType(typeFactory)).thenReturn(mock(RelDataType.class)); rootSchemaPlus.add(tableMockName, nonFlinkTableMock); Prepare.PreparingTable resultTable = catalogReader.getTable(Arrays.asList(tableMockName)); assertFalse(resultTable instanceof FlinkRelOptTable); }