code: public static Path findWithEnding(Path basePath, String... endings) {
          for (String ending : endings) {
              Path newPath = basePath.resolveSibling(basePath.getFileName() + ending);
              if (Files.exists(newPath)) {
                  return newPath;
              }
          }
  
          return null;
      }
docs: Finds a path with various endings or null if not found.
  
  @param basePath the base name
  @param endings a list of endings to search for
  @return new path or null if not found