@Override
  public <T> T loadObject(String accountName, ObjectType objectType, String objectKey)
      throws IllegalArgumentException, NotFoundException {
    if (objectType.equals(ObjectType.CANARY_RESULT_ARCHIVE)) {
      var record =
          sqlCanaryArchiveRepo
              .findById(objectKey)
              .orElseThrow(() -> new NotFoundException("Not found object for id: " + objectKey));

      return mapToObject(record.getContent(), objectType);
    }

    if (objectType.equals(ObjectType.CANARY_CONFIG)) {
      var record =
          sqlCanaryConfigRepo
              .findById(objectKey)
              .orElseThrow(() -> new NotFoundException("Not found object for id: " + objectKey));

      return mapToObject(record.getContent(), objectType);
    }

    if (objectType.equals(ObjectType.METRIC_SET_PAIR_LIST)) {
      var record =
          sqlMetricSetPairsRepo
              .findById(objectKey)
              .orElseThrow(() -> new NotFoundException("Not found object for id: " + objectKey));

      return mapToObject(record.getContent(), objectType);
    }

    if (objectType.equals(ObjectType.METRIC_SET_LIST)) {
      var record =
          sqlMetricSetsRepo
              .findById(objectKey)
              .orElseThrow(() -> new NotFoundException("Not found object for id: " + objectKey));

      return mapToObject(record.getContent(), objectType);
    }

    throw new IllegalArgumentException("Unsupported object type: " + objectType);
  }
@Test
  public void testLoadObjectWhenMetricSetPairs() throws IOException {
    var testAccountName = UUID.randomUUID().toString();
    var testObjectType = ObjectType.METRIC_SET_PAIR_LIST;
    var testObjectKey = UUID.randomUUID().toString();

    var testMetricSetPair = createTestMetricSetPair();

    var testSqlMetricSetPairs = createTestSqlMetricSetPairs(testMetricSetPair);
    testSqlMetricSetPairs.setId(testObjectKey);

    when(sqlMetricSetPairsRepo.findById(testObjectKey))
        .thenReturn(Optional.of(testSqlMetricSetPairs));

    var metricSetPairs =
        (List<MetricSetPair>)
            sqlStorageService.loadObject(testAccountName, testObjectType, testObjectKey);

    assertNotNull(metricSetPairs);
    assertEquals(metricSetPairs.size(), 1);

    var metricSetPair = metricSetPairs.get(0);

    assertEquals(metricSetPair.getId(), testMetricSetPair.getId());
    assertEquals(metricSetPair.getName(), testMetricSetPair.getName());
    assertEquals(metricSetPair.getTags(), testMetricSetPair.getTags());
    assertEquals(metricSetPair.getValues(), testMetricSetPair.getValues());
    assertEquals(metricSetPair.getAttributes(), testMetricSetPair.getAttributes());
    assertEquals(metricSetPair.getScopes(), testMetricSetPair.getScopes());
  }