### Question:
ExampleMetadataHandler extends MetadataHandler { @Override public void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker) throws Exception { for (int year = 2000; year < 2018; year++) { for (int month = 1; month < 12; month++) { for (int day = 1; day < 31; day++) { final int yearVal = year; final int monthVal = month; final int dayVal = day; } } } } ExampleMetadataHandler(); @VisibleForTesting protected  ExampleMetadataHandler(EncryptionKeyFactory keyFactory,
            AWSSecretsManager awsSecretsManager,
            AmazonAthena athena,
            String spillBucket,
            String spillPrefix); @Override ListSchemasResponse doListSchemaNames(BlockAllocator allocator, ListSchemasRequest request); @Override ListTablesResponse doListTables(BlockAllocator allocator, ListTablesRequest request); @Override GetTableResponse doGetTable(BlockAllocator allocator, GetTableRequest request); @Override void getPartitions(BlockWriter blockWriter, GetTableLayoutRequest request, QueryStatusChecker queryStatusChecker); @Override GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest request);  }### Answer:
@Test public void getPartitions() throws Exception { if (!enableTests) { logger.info("getPartitions: Tests are disabled, to enable them set the 'publishing' environment variable " + "using maven clean install -Dpublishing=true"); return; } logger.info("doGetTableLayout - enter"); Schema tableSchema = SchemaBuilder.newBuilder() .addIntField("day") .addIntField("month") .addIntField("year") .build(); Set<String> partitionCols = new HashSet<>(); partitionCols.add("day"); partitionCols.add("month"); partitionCols.add("year"); Map<String, ValueSet> constraintsMap = new HashMap<>(); constraintsMap.put("day", SortedRangeSet.copyOf(Types.MinorType.INT.getType(), ImmutableList.of(Range.greaterThan(allocator, Types.MinorType.INT.getType(), 0)), false)); constraintsMap.put("month", SortedRangeSet.copyOf(Types.MinorType.INT.getType(), ImmutableList.of(Range.greaterThan(allocator, Types.MinorType.INT.getType(), 0)), false)); constraintsMap.put("year", SortedRangeSet.copyOf(Types.MinorType.INT.getType(), ImmutableList.of(Range.greaterThan(allocator, Types.MinorType.INT.getType(), 2000)), false)); GetTableLayoutRequest req = null; GetTableLayoutResponse res = null; try { req = new GetTableLayoutRequest(fakeIdentity(), "queryId", "default", new TableName("schema1", "table1"), new Constraints(constraintsMap), tableSchema, partitionCols); res = handler.doGetTableLayout(allocator, req); logger.info("doGetTableLayout - {}", res); Block partitions = res.getPartitions(); for (int row = 0; row < partitions.getRowCount() && row < 10; row++) { logger.info("doGetTableLayout:{} {}", row, BlockUtils.rowToString(partitions, row)); } assertTrue(partitions.getRowCount() > 0); logger.info("doGetTableLayout: partitions[{}]", partitions.getRowCount()); } finally { try { req.close(); res.close(); } catch (Exception ex) { logger.error("doGetTableLayout: ", ex); } } logger.info("doGetTableLayout - exit"); }