title: How to return multiple objects in java given a certain parameter
body: <p>The method below takes in a <code>starRating</code> from a user and searches the Array to match that rating. When the value matches one of the objects it should return it. Although the method works it only returns one <code>Movie</code> object that it finds, not every single one. For example if I enter 3 it returns the first movie that has a star rating of 3 then does not do anything. Also how can I return an empty list if the star rating does not exist? I've done a bit of research and I can't seem to find anything that helps. Thanks.</p>
  
  <pre><code>/**
   * Write a method that returns a list of movies with the given star rating.
   * Return an empty list if the star rating does not exist.
   */
  public Movie getMoviesWithRating(int rating)
  {
      for (Movie movies : movies){
          if(movies.getStarRating() == rating){
              return movies;
          }
      }
      return //EmptyList
  }
  </code></pre>