Remove Duplicates in Java The objective of this assignment is to write a method that willremove any
Question:
Remove Duplicates in Java
The objective of this assignment is to write a method that willremove any duplicate values from an Integer ArrayList.
There will only be one class in this assignment.
In the main class ...
Write a method called removeDuplicates that accepts anArrayList of type Integer as a parameter. In addition to removingany duplicate values, the method should print which values areremoved (see desired formatting below), and return the modifiedArrayList.
In the main method, you should create atleast one ArrayList, but may create more if you wouldlike to test your removeDuplicates with other options.The mandatory ArrayList should be filled with 20 random integersfrom 1 to 10, inclusive. Before AND after youcall the removeDuplicates method, you should print out the currentstate of the ArrayList (see desired formatting below).
Example:
Original list: 3 5 1 2 3 9 10 10 7 1 3 4 8 10 7 5 2 6 4 2
Removed: 3
Removed: 3
Removed: 5
Removed: 1
Removed: 2
Removed: 2
Removed: 10
Removed: 10
Removed: 7
Removed: 4
List without Duplicates: 3 5 1 2 9 10 7 4 8 6
Note:
Your removeDuplicates method should be able to accept anyArrayList and act in the same way as it does with the randomlyfilled ArrayList as specified above.
You will be graded on the functionality of the interactionbetween the main method and the removeDuplicates method as well asthe independent function of the removeDuplicates method
Auditing and Assurance Services
ISBN: 978-0077862343
6th edition
Authors: Timothy Louwers, Robert Ramsay, David Sinason, Jerry Straws