test_class.declarator: METRIC_JSON =
              JsonObject.newBuilder()
                      .set("consumed",
                              JsonObject.newBuilder()
                                      .set("success", TestConstants.MEASUREMENTS)
                                      .set("failure", TestConstants.MEASUREMENTS)
                                      .build()
                      )
                      .set("mapped",
                              JsonObject.newBuilder()
                                      .set("success", TestConstants.MEASUREMENTS)
                                      .set("failure", TestConstants.MEASUREMENTS)
                                      .build()
                      )
                      .build()
test_class.modifier: private static final
test_class.original_string: private static final JsonObject METRIC_JSON =
              JsonObject.newBuilder()
                      .set("consumed",
                              JsonObject.newBuilder()
                                      .set("success", TestConstants.MEASUREMENTS)
                                      .set("failure", TestConstants.MEASUREMENTS)
                                      .build()
                      )
                      .set("mapped",
                              JsonObject.newBuilder()
                                      .set("success", TestConstants.MEASUREMENTS)
                                      .set("failure", TestConstants.MEASUREMENTS)
                                      .build()
                      )
                      .build();
test_class.type: JsonObject
test_class.var_name: METRIC_JSON
test_class.declarator: ADDRESS_METRIC = ConnectivityModelFactory.newAddressMetric(INBOUND_MEASUREMENTS)
test_class.modifier: private static final
test_class.original_string: private static final AddressMetric ADDRESS_METRIC = ConnectivityModelFactory.newAddressMetric(INBOUND_MEASUREMENTS);
test_class.type: AddressMetric
test_class.var_name: ADDRESS_METRIC
test_class.file: model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/ImmutableAddressMetricTest.java
test_class.identifier: ImmutableAddressMetricTest
test_case.body: @Test
      public void toJsonReturnsExpected() {
          final JsonObject actual = ADDRESS_METRIC.toJson();
          assertThat(actual).isEqualTo(METRIC_JSON);
      }
test_case.class_method_signature: ImmutableAddressMetricTest.toJsonReturnsExpected()
test_case.full_signature: @Test public void toJsonReturnsExpected()
test_case.identifier: toJsonReturnsExpected
test_case.invocations: toJson isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toJsonReturnsExpected()
focal_class.declarator: SUCCESS_KEY = JsonFactory.newKey("success")
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKey SUCCESS_KEY = JsonFactory.newKey("success");
focal_class.type: JsonKey
focal_class.var_name: SUCCESS_KEY
focal_class.declarator: FAILURE_KEY = JsonFactory.newKey("failure")
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKey FAILURE_KEY = JsonFactory.newKey("failure");
focal_class.type: JsonKey
focal_class.var_name: FAILURE_KEY
focal_class.declarator: measurements
focal_class.modifier: private final
focal_class.original_string: private final Set<Measurement> measurements;
focal_class.type: Set<Measurement>
focal_class.var_name: measurements
focal_class.file: model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableAddressMetric.java
focal_class.identifier: ImmutableAddressMetric
focal_class.interfaces: implements AddressMetric
focal_class.class_method_signature: ImmutableAddressMetric.ImmutableAddressMetric(final Set<Measurement> measurements)
focal_class.full_signature: private  ImmutableAddressMetric(final Set<Measurement> measurements)
focal_class.identifier: ImmutableAddressMetric
focal_class.modifiers: private
focal_class.parameters: (final Set<Measurement> measurements)
focal_class.signature:  ImmutableAddressMetric(final Set<Measurement> measurements)
focal_class.class_method_signature: ImmutableAddressMetric.of(final Set<Measurement> measurements)
focal_class.full_signature: public static ImmutableAddressMetric of(final Set<Measurement> measurements)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final Set<Measurement> measurements)
focal_class.return: ImmutableAddressMetric
focal_class.signature: ImmutableAddressMetric of(final Set<Measurement> measurements)
focal_class.class_method_signature: ImmutableAddressMetric.getMeasurements()
focal_class.full_signature: @Override public Set<Measurement> getMeasurements()
focal_class.identifier: getMeasurements
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<Measurement>
focal_class.signature: Set<Measurement> getMeasurements()
focal_class.class_method_signature: ImmutableAddressMetric.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: toJson
focal_class.modifiers: @Override public
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableAddressMetric.getMeasurementComparator()
focal_class.full_signature: private static Comparator<Measurement> getMeasurementComparator()
focal_class.identifier: getMeasurementComparator
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Comparator<Measurement>
focal_class.signature: Comparator<Measurement> getMeasurementComparator()
focal_class.class_method_signature: ImmutableAddressMetric.calculateComparatorScore(final List<MetricType> sortedTypes, final Measurement m1,
              final Measurement m2)
focal_class.full_signature: private static int calculateComparatorScore(final List<MetricType> sortedTypes, final Measurement m1,
              final Measurement m2)
focal_class.identifier: calculateComparatorScore
focal_class.modifiers: private static
focal_class.parameters: (final List<MetricType> sortedTypes, final Measurement m1,
              final Measurement m2)
focal_class.return: int
focal_class.signature: int calculateComparatorScore(final List<MetricType> sortedTypes, final Measurement m1,
              final Measurement m2)
focal_class.class_method_signature: ImmutableAddressMetric.fromJson(final JsonObject jsonObject)
focal_class.full_signature: public static AddressMetric fromJson(final JsonObject jsonObject)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonObject)
focal_class.return: AddressMetric
focal_class.signature: AddressMetric fromJson(final JsonObject jsonObject)
focal_class.class_method_signature: ImmutableAddressMetric.equals(final Object o)
focal_class.full_signature: @Override public boolean equals(final Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (final Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object o)
focal_class.class_method_signature: ImmutableAddressMetric.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ImmutableAddressMetric.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: ImmutableAddressMetric.toJsonField(final String key, final AddressMetric metric)
focal_class.full_signature: static JsonField toJsonField(final String key, final AddressMetric metric)
focal_class.identifier: toJsonField
focal_class.modifiers: static
focal_class.parameters: (final String key, final AddressMetric metric)
focal_class.return: JsonField
focal_class.signature: JsonField toJsonField(final String key, final AddressMetric metric)
focal_method.body: @Override
      public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) {
          if (measurements.isEmpty()) {
              return JsonFactory.nullObject();
          } else {
              final Predicate<JsonField> predicate = schemaVersion.and(thePredicate);
              final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder();
              jsonObjectBuilder.set(JsonFields.SCHEMA_VERSION, schemaVersion.toInt(), predicate);
              final List<Measurement> sortedMeasurements = new ArrayList<>(measurements);
              sortedMeasurements.sort(getMeasurementComparator());
              for (final Measurement measurement : sortedMeasurements) {
                  final JsonPointer pointer = JsonFactory.newPointer(
                          JsonFactory.newKey(measurement.getMetricType().getName()),
                          measurement.isSuccess() ? SUCCESS_KEY : FAILURE_KEY);
                  jsonObjectBuilder.set(pointer, measurement.toJson().getValue(pointer).orElse(JsonFactory.newObject()));
              }
              return jsonObjectBuilder.build();
          }
      }
focal_method.class_method_signature: ImmutableAddressMetric.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.identifier: toJson
focal_method.invocations: isEmpty nullObject and newObjectBuilder set toInt sort getMeasurementComparator newPointer newKey getName getMetricType isSuccess set orElse getValue toJson newObject build
focal_method.modifiers: @Override public
focal_method.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.return: JsonObject
focal_method.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)