class RepositoryCleanupAttributesUtil {

  public static void initializeCleanupAttributes(final RepositoryXO repositoryXO) {
    checkNotNull(repositoryXO);

    Map<String, Map<String, Object>> attributes = checkNotNull(repositoryXO.getAttributes());
    Map<String, Object> cleanup = attributes.get(CLEANUP_ATTRIBUTES_KEY);
    if (nonNull(cleanup)) {

      @SuppressWarnings("unchecked")
      Collection<String> policyNames = (Collection<String>) cleanup.get(CLEANUP_NAME_KEY);

      if(isNull(policyNames) || policyNames.isEmpty()) {
        attributes.remove(CLEANUP_ATTRIBUTES_KEY);
      } else {
        cleanup.put(CLEANUP_NAME_KEY, newLinkedHashSet(policyNames));
      }
    }
  }

  private  RepositoryCleanupAttributesUtil();

}