In the following code I read text file with a list of movies and create a String array of the list of movies using a helper method. Within the method I am able to read and print each line of the file. However, when I attempt to iterate over the returned array in the main method I get only "null". Why is this happening. In my research so far, I have not been able to find a similar problem posted by someone else. Please help. Thanks.

```
import java.util.Random;
import java.util.Scanner;
import java.io.File;

public class GuessTheMovie {

    public static void main(String[] args) throws Exception {

        try {
            // Create File and Scanner objects
            File file = new File("movies.txt");
            Scanner scanner = new Scanner(file);

            // Create String array to store all movie titles
            List<String> movies = createMoviesArray(scanner);
            for (String movie : movies) {
                System.out.println(movie);
        }
            /*
            String[] movies = createMoviesArray(scanner);
            for (int i = 0; i < movies.length; i++) {
                System.out.println(movies[i]);
            } */

    } catch (Exception e) {
        System.out.println("Could not find file.");
    }

}

////////////////////////// HELPER METHODS ////////////////////////////////////
/*
// Create String array to store all movie titles
private static String[] createMoviesArray(Scanner scanner) {
    int count = 0;
    String[] movies; // = new String[500];
    while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        System.out.println(count + " : " + line);
        count += 1;
    }
    movies = new String[count];
    return movies;
}*/

private static List<String> createMoviesArray(Scanner scanner) {
    List<String> movies = new ArrayList<>();
    // get line count for the size of the array
    while (scanner.hasNextLine()) {
        movies.add(scanner.nextLine());
    }
    return movies;
}

```