public static void persistSentPatch(
      @NotNull String patchStr, @NotNull SentUsagesPersistence persistenceComponent) {
    Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages =
        mapToPatchedUsagesMap(ConvertUsagesUtil.convertString(patchStr));

    if (patchedUsages.size() > 0) persistenceComponent.persistPatch(patchedUsages);
  }
  @NotNull
  public static Map<GroupDescriptor, Set<PatchedUsage>> getPatchedUsages(
      @NotNull Set<String> disabledGroups,
      @NotNull Project[] projects,
      @NotNull SentUsagesPersistence usagesPersistence) {
    Map<GroupDescriptor, Set<PatchedUsage>> usages =
        new LinkedHashMap<GroupDescriptor, Set<PatchedUsage>>();

    for (Project project : projects) {
      final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages =
          getAllUsages(project, disabledGroups);
      final Map<GroupDescriptor, Set<UsageDescriptor>> sentUsages =
          filterDisabled(disabledGroups, usagesPersistence.getSentUsages());

      usages.putAll(getPatchedUsages(allUsages, sentUsages));
    }
    return usages;
  }
 public static boolean isSendAllowed(final SentUsagesPersistence settings) {
   return settings != null && settings.isAllowed();
 }
 @NotNull
 public static Map<GroupDescriptor, Set<PatchedUsage>> getPatchedUsages(
     @NotNull final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages,
     @NotNull SentUsagesPersistence usagesPersistence) {
   return getPatchedUsages(allUsages, usagesPersistence.getSentUsages());
 }