public static boolean addDefaultTags(InstanceConfig instanceConfig, Supplier<List<String>> defaultTagsSupplier) {
    List<String> instanceTags = instanceConfig.getTags();
    if (instanceTags.isEmpty()) {
      List<String> defaultTags = defaultTagsSupplier.get();
      if (!CollectionUtils.isEmpty(defaultTags)) {
        LOGGER.info("Updating instance: {} with default tags: {}", instanceConfig.getId(), instanceTags);
        for (String defaultTag : defaultTags) {
          instanceConfig.addTag(defaultTag);
        }
        return true;
      }
    }
    return false;
  }
@Test
  public void testAddDefaultTags() {
    String instanceId = "Server_myInstance";
    InstanceConfig instanceConfig = new InstanceConfig(instanceId);
    List<String> defaultTags = Arrays.asList("tag1", "tag2");
    assertTrue(HelixHelper.addDefaultTags(instanceConfig, () -> defaultTags));
    assertEquals(instanceConfig.getTags(), defaultTags);

    assertFalse(HelixHelper.addDefaultTags(instanceConfig, () -> defaultTags));
    assertEquals(instanceConfig.getTags(), defaultTags);

    List<String> otherTags = Arrays.asList("tag3", "tag4");
    assertFalse(HelixHelper.addDefaultTags(instanceConfig, () -> otherTags));
    assertEquals(instanceConfig.getTags(), defaultTags);
  }