hunk.code_window:                                     Map.Entry<String, Organization> organizationEntry = orgIterator.next();
                                       String orgId = organizationEntry.getKey();
                                       Organization organization = organizationEntry.getValue();
                                       Collection<Application> applicationCollection = applicationsCollectionByOrgId.get(orgId);
                                       List<Application> applicationList = null;
                                       if (applicationCollection!=null && !applicationCollection.isEmpty()) {
                                           applicationList = applicationCollection.stream().collect(Collectors.toList());
                                       }
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit:                                     List<Application> applicationList = new ArrayList<>();
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationServiceImpl.java
hunk.type: replace
file: package com.appsmith.server.services;
  
  import com.appsmith.server.constants.FieldName;
  import com.appsmith.server.domains.Config;
  import com.appsmith.server.exceptions.AppsmithError;
  import com.appsmith.server.exceptions.AppsmithException;
  import com.appsmith.server.repositories.ConfigRepository;
  import lombok.extern.slf4j.Slf4j;
  import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
  import org.springframework.data.mongodb.core.convert.MongoConverter;
  import org.springframework.stereotype.Service;
  import reactor.core.publisher.Mono;
  import reactor.core.scheduler.Scheduler;
  
  import javax.validation.Validator;
  
  @Slf4j
  @Service
  public class ConfigServiceImpl extends BaseService<ConfigRepository, Config, String> implements ConfigService {
  
      public ConfigServiceImpl(Scheduler scheduler,
                               Validator validator,
                               MongoConverter mongoConverter,
                               ReactiveMongoTemplate reactiveMongoTemplate,
                               ConfigRepository repository,
                               AnalyticsService analyticsService) {
          super(scheduler, validator, mongoConverter, reactiveMongoTemplate, repository, analyticsService);
      }
  
      @Override
      public Mono<Config> getByName(String name) {
          return repository.findByName(name)
                  .switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, FieldName.CONFIG, name)));
      }
  
      @Override
      public Mono<Config> updateByName(String name, Config config) {
          return repository.findByName(name)
                  .switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, FieldName.CONFIG, name)))
                  .flatMap(dbConfig -> {
                      log.debug("Found config with name: {} and id: {}", name, dbConfig.getId());
                      dbConfig.setConfig(config.getConfig());
                      return repository.save(dbConfig);
                  });
      }
  }
  