package com.max.soundboard;

import java.io.File;
import java.util.ArrayList;


class FileManager {
    private FileManager() {}

    public static ArrayList<String> getSubdirectories(String path) {
        ArrayList<String> subdirectories = new ArrayList<>();
        File[] files = new File(path).listFiles();

        if (files != null) {
            for (File file : files) {
                if (file.isDirectory()) {
                    subdirectories.add(file.getName());
                }
            }
        }
        return subdirectories;
    }

    public static ArrayList<String> getSoundFileNames(String path) {
        ArrayList<String> soundFiles = new ArrayList<>();

        for (File file : new File(path).listFiles()) {
            if (file.isFile() && isSoundFileName(file.getName())) {
                soundFiles.add(file.getName());
            }
        }
        return soundFiles;
    }

    private static boolean isSoundFileName(String filename) {
        return filename.endsWith(".mp3") || filename.endsWith(".wav");
    }
}

@@ -71,16 +71,39 @@
 ayList;%0A
+import java.util.List;%0A
 %0A%0Aclass 
@@ -143,16 +143,21 @@
 ager() %7B
+%0A    
 %7D%0A%0A    p
@@ -161,37 +161,32 @@
   public static 
-Array
 List%3CString%3E get
@@ -215,37 +215,32 @@
 path) %7B%0A        
-Array
 List%3CString%3E sub
@@ -272,24 +272,25 @@
 st%3C%3E();%0A
+%0A
         
 File%5B%5D f
@@ -285,22 +285,24 @@
     
+for (
 File
-%5B%5D
  file
-s =
+ :
  new
@@ -328,82 +328,12 @@
 es()
-;%0A%0A        if (files != null) %7B%0A            for (File file : files) %7B%0A    
+) %7B%0A
     
@@ -362,28 +362,24 @@
 ectory()) %7B%0A
-    
             
@@ -426,34 +426,26 @@
             
-    %7D%0A    
+%7D%0A
         %7D%0A  
@@ -438,34 +438,24 @@
 %7D%0A        %7D%0A
-        %7D%0A
         retu
@@ -498,21 +498,16 @@
  static 
-Array
 List%3CStr
@@ -552,21 +552,16 @@
         
-Array
 List%3CStr

Use generic types in Filemanager