Please help to create two separate Java codes resulting in the same output (one using Apache Commons library and one using the standard Java methods). The program should count all people with the same last name and then change the last name to Doe.
See the attachments.
When using the Apache Commons library it has been suggested to use countMatches(), select() and replace() or overlay() methods though I have not been able to find documentation on the select() method.
I have attached my Person class and the Tester programs which reads in a text file with the Person data, parses the data and puts into an arrayList and then sorts by last name. All of this is functional. The problem I run into is comparing the last names. If I could specify in advance the string I am comparing and just spit that count out I can do that easily, however I do not know how to start this when I do not know what if any names match.
I created a new class called PersonUtils. It has two static functions to replace duplicate ...
The solution discusses the Java array manipulation with and without Java 3rd party libraries.