@@ -0,0 +1,1216 @@
+public class Program %7B%0A    public static void main(String%5B%5D args) %7B%0A        ArrayList%3Cstring%3E permutations = getPermutations(%22abc%22);%0A        %0A        assert permutations.size() == 6;%0A        assert permutations.contains(%22abc%22);%0A        assert permutations.contains(%22acb%22);%0A        assert permutations.contains(%22bac%22);%0A        assert permutations.contains(%22bca%22);%0A        assert permutations.contains(%22cab%22);%0A        assert permutations.contains(%22cba%22);%0A%0A%09%09System.out.println(%22Tests passed%22);%0A    %7D%0A  %0A    public static ArrayList%3CString%3E getPermutations(String text) %7B%0A        ArrayList%3CString%3E results = new ArrayList%3CString%3E();%0A    %0A        // the base case%0A        if (text.length() == 1) %7B%0A            results.add(text);%0A            return results;%0A        %7D%0A        %0A        for (int i = 0; i %3C text.length(); i++) %7B%0A            char first = text.charAt(i);%0A            String remains = text.substring(0, i) + text.substring(i + 1);%0A            %0A            ArrayList%3CString%3E innerPermutations = getPermutations(remains);%0A            %0A            for (int j = 0; j %3C innerPermutations.size(); j++)%0A                results.add(first + innerPermutations.get(j));%0A        %7D%0A        %0A        return results;%0A    %7D%0A%7D%0A

Create Program.java