"And here are new tasks for my friend:"
Refactoring, anonymous classes
Be sure that the getIterator method returns an anonymous class. Transfer the LocalIterator logic to an anonymous class. Only change the body of the getIterator method.
Let's recall inheritance
Fix inheritance in all the classes so that the output of the main method is "CCBAYS".
Knowledge is power!
1. In the sort method, write a comparator for Stock: 1.1. Sort first by name in alphabetical order 1.2. Sort second by date without accounting for hours, minutes, and seconds (with the newest on top), and then by profit from positive to negative ... open 125.64 and last 126.74. Here the gain is 126