import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.charset.StandardCharsets;

public class FuzzySearch {

    private List<String> FILE_CATALOG = new ArrayList<>();

    public FuzzySearch() throws IOException {
        Path catalogFile = FileSystems.getDefault().getPath("test/resources", "files.txt");
        FILE_CATALOG = Files.readAllLines(catalogFile, StandardCharsets.UTF_8);
    }

    public String[] find(String pattern) {
        String s = FILE_CATALOG.get(0);
        System.out.println("s = " + s);
        return new String[]{};
    }
}
@@ -37,45 +37,36 @@
 ava.
-util.List;%0Aimport java.util.ArrayList
+nio.charset.StandardCharsets
 ;%0Aim
@@ -168,262 +168,1923 @@
 ava.
-nio.charset.StandardCharsets;%0A%0Apublic class FuzzySearch %7B%0A%0A    private List%3CString%3E FILE_CATALOG = new ArrayList%3C%3E();%0A%0A    public FuzzySearch() throws IOException %7B%0A        Path catalogFile = FileSystems.getDefault().getPath(%22test/resources%22
+util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0A%0Apublic class FuzzySearch %7B%0A%0A    public static final String FILE_CATALOG_FILENAME = %22files.txt%22;%0A    public static final String FILE_CATALOG_FILE = %22test/resources%22;%0A    private List%3CString%3E FILE_CATALOG = new ArrayList%3C%3E();%0A    private static final HashMap%3CString, String%5B%5D%3E LOOKUP = new HashMap%3C%3E();%0A%0A    public FuzzySearch() throws IOException %7B%0A        populateFileCatalog();%0A%0A        String fileName = %22java_challenges/Hanoi/src/CharacterDisplay.java%22;%0A        populateSearchTree(fileName, fileName);%0A%0A//        for (String fileName : FILE_CATALOG) %7B%0A//            populateSearchTree(fileName, fileName);%0A//            System.out.println();%0A//        %7D%0A    %7D%0A%0A    private void populateSearchTree(String partialName, String fileName) %7B%0A        boolean found = LOOKUP.containsKey(partialName);%0A        if (found) %7B%0A            String%5B%5D fileList = LOOKUP.get(partialName);%0A            if (!fileList%5BfileList.length - 1%5D.equals(fileName)) %7B%0A                System.out.println(%22partialName = %22 + partialName);%0A                fileList%5BfileList.length%5D = fileName;%0A                LOOKUP.put(partialName, fileList);%0A            %7D%0A        %7D else %7B%0A            System.out.println(%22partialName = %22 + partialName);%0A            LOOKUP.put(partialName, new String%5B%5D%7BfileName%7D);%0A            for (int i = 0; i %3C partialName.length(); i++) %7B%0A                String front = (i == 0) ? %22%22 : partialName.substring(0, i);%0A                String back = (i %3E= partialName.length() - 1) ? %22%22 : partialName.substring(i + 1, partialName.length());%0A                if (partialName.length() %3E 1) %7B%0A                    populateSearchTree(front + back
 , 
-%22
 file
-s.txt%22
+Name);%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    private void populateFileCatalog() throws IOException %7B%0A        Path catalogFile = FileSystems.getDefault().getPath(FILE_CATALOG_FILE, FILE_CATALOG_FILENAME
 );%0A 

use lookup based on a fully populated Hashmap - apparently not performant