### Question:
DocDBMetadataHandler extends GlueMetadataHandler { @Override public ListTablesResponse doListTables(BlockAllocator blockAllocator, ListTablesRequest request) { MongoClient client = getOrCreateConn(request); List<TableName> tables = new ArrayList<>(); try (MongoCursor<String> itr = client.getDatabase(request.getSchemaName()).listCollectionNames().iterator()) { while (itr.hasNext()) { tables.add(new TableName(request.getSchemaName(), itr.next())); } return new ListTablesResponse(request.getCatalogName(), tables); } } DocDBMetadataHandler(); @VisibleForTesting protected  DocDBMetadataHandler(AWSGlue glue,
            DocDBConnectionFactory connectionFactory,
            EncryptionKeyFactory keyFactory,
            AWSSecretsManager secretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix); @Override ListSchemasResponse doListSchemaNames(BlockAllocator blockAllocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator blockAllocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator blockAllocator, GetTableRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator blockAllocator, GetSplitsRequest request);  }### Answer:
@Test public void doListTables() { List<String> tableNames = new ArrayList<>(); tableNames.add("table1"); tableNames.add("table2"); tableNames.add("table3"); MongoDatabase mockDatabase = mock(MongoDatabase.class); when(mockClient.getDatabase(eq(DEFAULT_SCHEMA))).thenReturn(mockDatabase); when(mockDatabase.listCollectionNames()).thenReturn(StubbingCursor.iterate(tableNames)); ListTablesRequest req = new ListTablesRequest(IDENTITY, QUERY_ID, DEFAULT_CATALOG, DEFAULT_SCHEMA); ListTablesResponse res = handler.doListTables(allocator, req); logger.info("doListTables - {}", res.getTables()); for (TableName next : res.getTables()) { assertEquals(DEFAULT_SCHEMA, next.getSchemaName()); assertTrue(tableNames.contains(next.getTableName())); } assertEquals(tableNames.size(), res.getTables().size()); }