### Question:
JsonResult { @VisibleForTesting static Map<String, JsonTestBucket> generateJsonBuckets(final ProctorResult result) { final Map<String, ConsumableTestDefinition> definitions = result.getTestDefinitions(); return result.getBuckets().entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> new JsonTestBucket( e.getValue(), definitions.get(e.getKey()).getVersion()))); } JsonResult(final ProctorResult result,
                      final Map<String, Object> context,
                      final Audit audit); Map<String, JsonTestBucket> getGroups(); Map<String, Object> getContext(); Audit getAudit();  }### Answer:
@Test public void testGenerateJsonBuckets() { final Map<String, ConsumableTestDefinition> testDefinitions = ImmutableMap.of("control", stubDefinitionWithVersion("vControl")); final Map<String, TestBucket> buckets = ImmutableMap.of("control", new TestBucket("fooname", -1, "foodesc")); ProctorResult result = new ProctorResult("0", buckets, emptyMap(), testDefinitions); assertThat(JsonResult.generateJsonBuckets(result)) .hasSize(1) .containsKey("control") .hasEntrySatisfying("control", jsonTestBucket -> { assertThat(jsonTestBucket.getVersion()).isEqualTo("vControl"); }); result = new ProctorResult("0", emptyMap(), emptyMap(), emptyMap()); assertThat(JsonResult.generateJsonBuckets(result)).isEqualTo(emptyMap()); }