code: private List<File> getAllPossibleExternalConfigDirFilenames(final File configDirectory, final List<String> profiles) {
          val applicationName = casConfigurationPropertiesEnvironmentManager.getApplicationName();
          val appNameLowerCase = applicationName.toLowerCase();
          val fileNames = CollectionUtils.wrapList("application", appNameLowerCase, applicationName)
              .stream()
              .distinct()
              .flatMap(appName -> EXTENSIONS
                  .stream()
                  .map(ext -> new File(configDirectory, String.format("%s.%s", appName, ext))))
              .collect(Collectors.toList());
  
          fileNames.addAll(profiles
              .stream()
              .flatMap(profile -> EXTENSIONS
                  .stream()
                  .flatMap(ext -> PROFILE_PATTERNS
                      .stream().map(pattern -> new File(configDirectory, String.format(pattern, profile, ext))))).collect(Collectors.toList()));
  
          fileNames.add(new File(configDirectory, appNameLowerCase.concat(".groovy")));
          return fileNames;
      }
docs: Make a list of files that will be processed in order where the last one processed wins.
  Profiles are added after base property names like application.properties, cas.properties, CAS.properties so that
  the profiles will override the base properties.
  Profiles are processed in order so that the last profile list (e.g. in spring.active.profiles) will override the
  the first profile.
  Where multiple filenames with same base name and different extensions exist, the priority is yaml, yml, properties.