docs: public static TestSpecification generateSpecification(@Nonnull final TestDefinition testDefinition) {
          final TestSpecification testSpecification = new TestSpecification();
          // Sort buckets by value ascending
          final Map<String,Integer> buckets = Maps.newLinkedHashMap();
          final List<TestBucket> testDefinitionBuckets = Ordering.from(new Comparator<TestBucket>() {
              @Override
              public int compare(final TestBucket lhs, final TestBucket rhs) {
                  return Ints.compare(lhs.getValue(), rhs.getValue());
              }
          }).immutableSortedCopy(testDefinition.getBuckets());
          int fallbackValue = -1;
          if(testDefinitionBuckets.size() > 0) {
              final TestBucket firstBucket = testDefinitionBuckets.get(0);
              fallbackValue = firstBucket.getValue(); // buckets are sorted, choose smallest value as the fallback value
  
              final PayloadSpecification payloadSpecification = new PayloadSpecification();
              if(firstBucket.getPayload() != null && !firstBucket.getPayload().equals(Payload.EMPTY_PAYLOAD)) {
                  final PayloadType payloadType = PayloadType.payloadTypeForName(firstBucket.getPayload().fetchType());
                  payloadSpecification.setType(payloadType.payloadTypeName);
                  if (payloadType == PayloadType.MAP) {
                      final Map<String, String> payloadSpecificationSchema = new HashMap<String, String>();
                      for (Map.Entry<String, Object> entry : firstBucket.getPayload().getMap().entrySet()) {
                          payloadSpecificationSchema.put(entry.getKey(), PayloadType.payloadTypeForValue(entry.getValue()).payloadTypeName);
                      }
                      payloadSpecification.setSchema(payloadSpecificationSchema);
                  }
                  testSpecification.setPayload(payloadSpecification);
              }
  
              for (int i = 0; i < testDefinitionBuckets.size(); i++) {
                  final TestBucket bucket = testDefinitionBuckets.get(i);
                  buckets.put(bucket.getName(), bucket.getValue());
              }
          }
          testSpecification.setBuckets(buckets);
          testSpecification.setDescription(testDefinition.getDescription());
          testSpecification.setFallbackValue(fallbackValue);
          return testSpecification;
      }