Implemented Exercise 2 findFirst methods with a polymorphic function