import java.util.*; public class SetTestProgram3 { public static void main(String[] args) { Movie[] dvds = {new Movie("Bolt"), new Movie("Monsters Vs. Aliens"), new Movie("Marley & Me"), new Movie("Monsters Vs. Aliens"), new Movie("Hotel For Dogs"), new Movie("Hotel For Dogs"), new Movie("Monsters Vs. Aliens"), new Movie("The Day the Earth Stood Still"), new Movie("The Day the Earth Stood Still"), new Movie("The Day the Earth Stood Still"), new Movie("The Day the Earth Stood Still")}; ArrayList inventory = new ArrayList(); // Add 10 random movies from the list of dvds for (int i=0; i<10; i++) { inventory.add(dvds[(int)(Math.random()*11)]); } System.out.println("Here are the unique movies:"); HashSet displayList = new HashSet(inventory); for (Movie m: displayList) System.out.println(m); System.out.println("\nHere is the whole inventory:"); for (Movie m: inventory) System.out.println(m); } }