What problem are you trying to solve?
Code readability. Fewer diffs in git commits.
Have a text-based recipe to remove trailing whitespace in all lines. This would apply to both programs in Java and other languages, and other files - like Markdown files, etc. In the vast majority of normal files, extra space at the end of the line can be safely removed.
