hunk.code_window:                         .thenReturn(true);
               }
               log.debug("The invited user {} doesn't exist in the system. Creating a new record", inviteUser.getEmail());
               // The user doesn't exist in the system. Create a new user object
               newUser.setPassword(inviteUser.getPassword());
               return this.create(newUser)
                       .flatMap(createdUser -> userOrganizationService.addUserToOrganization(newUser.getCurrentOrganizationId(), createdUser))
                       .thenReturn(newUser)
                       .flatMap(userToDelete -> inviteUserRepository.delete(userToDelete))
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:             return this.createUser(newUser, originHeader)
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserServiceImpl.java
hunk.type: replace
file: package com.appsmith.server.helpers;
  
  import java.util.Collection;
  import java.util.Map;
  
  public class CollectionUtils {
  
      /**
       * Helper function to check if a collection is null or empty.
       *
       * @param c
       * @return
       */
      public static boolean isNullOrEmpty(final Collection<?> c) {
          return (c == null || c.isEmpty());
      }
  
      /**
       * Helper function to check if a map is null or empty
       *
       * @param m
       * @return
       */
      public static boolean isNullOrEmpty(final Map<?, ?> m) {
          return (m == null || m.isEmpty());
      }
  
  }
  