Simplified using a lambda expression.
Using the stream api.
Removed unused import.
Added a null test.
Using the stream api.
Using peek.
Improved Javadoc and logging.