### Question:
DynamoDBMetadataHandler extends GlueMetadataHandler { @Override public ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request) throws Exception { Set<TableName> combinedTables = new LinkedHashSet<>(); if (glueClient != null) { try { combinedTables.addAll(super.doListTables(allocator, request, TABLE_FILTER).getTables()); } catch (RuntimeException e) { logger.warn("doListTables: Unable to retrieve tables from AWSGlue in database/schema {}", request.getSchemaName(), e); } } if (DynamoDBConstants.DEFAULT_SCHEMA.equals(request.getSchemaName())) { combinedTables.addAll(tableResolver.listTables()); } return new ListTablesResponse(request.getCatalogName(), new ArrayList<>(combinedTables)); } DynamoDBMetadataHandler(); @VisibleForTesting  DynamoDBMetadataHandler(EncryptionKeyFactory keyFactory,
            AWSSecretsManager secretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix,
            AmazonDynamoDB ddbClient,
            AWSGlue glueClient); @Override ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator allocator, GetTableRequest request); @Override void enhancePartitionSchema(SchemaBuilder partitionSchemaBuilder, GetTableLayoutRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request);  }### Answer:
@Test public void doListTablesGlueAndDynamo() throws Exception { List<String> tableNames = new ArrayList<>(); tableNames.add("table1"); tableNames.add("table2"); tableNames.add("table3"); GetTablesResult mockResult = new GetTablesResult(); List<Table> tableList = new ArrayList<>(); tableList.add(new Table().withName("table1") .withParameters(ImmutableMap.of("classification", "dynamodb")) .withStorageDescriptor(new StorageDescriptor() .withLocation("some.location"))); tableList.add(new Table().withName("table2") .withParameters(ImmutableMap.of()) .withStorageDescriptor(new StorageDescriptor() .withLocation("some.location") .withParameters(ImmutableMap.of("classification", "dynamodb")))); tableList.add(new Table().withName("table3") .withParameters(ImmutableMap.of()) .withStorageDescriptor(new StorageDescriptor() .withLocation("arn:aws:dynamodb:us-east-1:012345678910:table/table3"))); tableList.add(new Table().withName("notADynamoTable").withParameters(ImmutableMap.of()).withStorageDescriptor( new StorageDescriptor().withParameters(ImmutableMap.of()).withLocation("some_location"))); mockResult.setTableList(tableList); when(glueClient.getTables(any())).thenReturn(mockResult); ListTablesRequest req = new ListTablesRequest(TEST_IDENTITY, TEST_QUERY_ID, TEST_CATALOG_NAME, DEFAULT_SCHEMA); ListTablesResponse res = handler.doListTables(allocator, req); logger.info("doListTables - {}", res.getTables()); List<TableName> expectedTables = tableNames.stream().map(table -> new TableName(DEFAULT_SCHEMA, table)).collect(Collectors.toList()); expectedTables.add(TEST_TABLE_NAME); expectedTables.add(new TableName(DEFAULT_SCHEMA, "test_table2")); expectedTables.add(new TableName(DEFAULT_SCHEMA, "test_table3")); expectedTables.add(new TableName(DEFAULT_SCHEMA, "test_table4")); assertThat(new HashSet<>(res.getTables()), equalTo(new HashSet<>(expectedTables))); }