public static boolean allowMerge(SegmentZKMetadata segmentZKMetadata) {
    Map<String, String> customMap = segmentZKMetadata.getCustomMap();
    return MapUtils.isEmpty(customMap) || !Boolean.parseBoolean(
        customMap.get(MergeTask.SEGMENT_ZK_METADATA_SHOULD_NOT_MERGE_KEY));
  }
@Test
  public void testAllowMerge() {
    SegmentZKMetadata segmentZKMetadata = new SegmentZKMetadata("seg01");
    assertNull(segmentZKMetadata.getCustomMap());
    assertTrue(MergeTaskUtils.allowMerge(segmentZKMetadata));

    segmentZKMetadata.setCustomMap(Collections.emptyMap());
    assertTrue(MergeTaskUtils.allowMerge(segmentZKMetadata));

    segmentZKMetadata
        .setCustomMap(Collections.singletonMap(MergeTask.SEGMENT_ZK_METADATA_SHOULD_NOT_MERGE_KEY, "false"));
    assertTrue(MergeTaskUtils.allowMerge(segmentZKMetadata));

    segmentZKMetadata
        .setCustomMap(Collections.singletonMap(MergeTask.SEGMENT_ZK_METADATA_SHOULD_NOT_MERGE_KEY, "true"));
    assertFalse(MergeTaskUtils.allowMerge(segmentZKMetadata));
  }