class CachingWordListLoader {

  // Speed up the server use case, where rules get initialized for every call.
  private static final LoadingCache<String, List<String>> cache = CacheBuilder.newBuilder()
      .expireAfterWrite(10, TimeUnit.MINUTES)
      .build(new CacheLoader<String, List<String>>() {
        @Override
        public List<String> load(@NotNull String fileInClassPath) throws IOException {<FILL_FUNCTION_BODY>}
      });

  public List<String> loadWords(String filePath) {
    return cache.getUnchecked(filePath);
  }
}

          List<String> result = new ArrayList<>();
          if (!JLanguageTool.getDataBroker().resourceExists(fileInClassPath)) {
            return result;
          }
          List<String> lines = JLanguageTool.getDataBroker().getFromResourceDirAsLines(fileInClassPath);
          for (String line : lines) {
            if (line.isEmpty() || line.startsWith("#")) {
              continue;
            }
            result.add(StringUtils.substringBefore(line.trim(), "#").trim());
          }
          return Collections.unmodifiableList(result);
        
<no_super_class>