import java.util.*; public class PizzaUtilities { public static Set availableToppings = new HashSet(); public static void main(String[] args) { availableToppings.add("pepperoni"); availableToppings.add("sausage"); availableToppings.add("mushrooms"); availableToppings.add("green peppers"); availableToppings.add("pineapple"); availableToppings.add("anchovies"); availableToppings.add("hamburger"); availableToppings.add("extra cheese"); Set people = new HashSet(); people.add("Fred"); people.add("Ben"); people.add("Susan"); people.add("Beth"); Map map = determinePreferences(people); Set toppings = selectRandomToppings(); Set eaters = determineEaters(map, toppings); Set possibleToppings = determineToppings(map); } /** * Generates a random set of toppings. * * @return Set of random toppings (Strings), where each topping in * availableToppings has a 50% chance of being included. */ public static Set selectRandomToppings(){ } /** * Given a Set of people, assigns to each person a random set of * "preferred" toppings. * * @param people - a set of Strings * @return Map assigning to each person a random set of toppings */ public static Map determinePreferences(Set people) { } /** * Given a potential pizza (a set of toppings), determines which people * want to eat it. * * @param map -- maps people (Strings) to their preferences (Sets of * toppings) * @param toppings -- set of toppings on a pizza that being offered * @return Set of persons who want to eat this pizza. (For a person to be * included, every item in "toppings" must also be on that person's * set of preferences.) */ public static Set determineEaters(Map map, Set toppings){ } /** * Given a map of people and their toppings preferences, determines a pizza * (a set of toppings) such that everyone is willing to eat it. * * @param map -- maps people (Strings) to their preferences (Sets of * toppings). * @return a Set of toppings that everyone can eat. (Any topping in * availableToppings will be included if EVERY person has listed it * as a preference.) */ public static Set determineToppings(Map map){ } }