### Question:
JmxMetadata implements ConnectorMetadata { @Override public List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName) { Set<String> schemaNames = schemaName.map(ImmutableSet::of) .orElseGet(() -> ImmutableSet.copyOf(listSchemaNames(session))); ImmutableList.Builder<SchemaTableName> schemaTableNames = ImmutableList.builder(); for (String schema : schemaNames) { if (JMX_SCHEMA_NAME.equals(schema)) { return listJmxTables(); } else if (HISTORY_SCHEMA_NAME.equals(schema)) { return jmxHistoricalData.getTables().stream() .map(tableName -> new SchemaTableName(JmxMetadata.HISTORY_SCHEMA_NAME, tableName)) .collect(toList()); } } return schemaTableNames.build(); } @Inject  JmxMetadata(MBeanServer mbeanServer, JmxHistoricalData jmxHistoricalData); @Override List<String> listSchemaNames(ConnectorSession session); @Override JmxTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName); @Override boolean usesLegacyTableLayouts(); @Override ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table); JmxTableHandle getTableHandle(SchemaTableName tableName); static String toPattern(String tableName); @Override ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle tableHandle); @Override List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName); @Override Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle); @Override ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle); @Override Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix); @Override Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(ConnectorSession session, ConnectorTableHandle handle, Constraint constraint); static final String JMX_SCHEMA_NAME; static final String HISTORY_SCHEMA_NAME; static final String NODE_COLUMN_NAME; static final String OBJECT_NAME_NAME; static final String TIMESTAMP_COLUMN_NAME; }### Answer:
@Test public void testListTables() { assertTrue(metadata.listTables(SESSION, Optional.of(JMX_SCHEMA_NAME)).contains(RUNTIME_TABLE)); assertTrue(metadata.listTables(SESSION, Optional.of(HISTORY_SCHEMA_NAME)).contains(RUNTIME_HISTORY_TABLE)); }