We will be using a sample Java 8 code base to try migrating to Java 9. It's a command-line shopping bag utility. When you run the application, it prompts you to add items to your shopping bag. Once you've added all the items and you are done, you type end. The application then displays a consolidated shopping list of items that you've added. The application is intentionally simple, but it gives us a good starting point to work through the migration.
Here's a screenshot of the application in action:
The application consists of three classes in three different packages:
- The ShoppingBag class: It contains a method to add items to a shopping bag, and one to pretty print the contents of the bag. The class uses the Bag data structure from the Apache Commons Collections library. Think of this data structure as something...