Write a 'generically type-defined class' Duplicator The class should have the following properties: 1 A constructor that takes an element of type T as a parameter. 2 Set and get methods for the element (getElement and setElement). 3 A method ArrayList getMany(int amount), which returns a new list. The size of the list is the integer given as a parameter, and each element of the list is the element stored in the object. An example of utilizing the class: public static void main(String[] args) { Duplicator d1 = new Duplicator<>("abc"); System.out.println(d1.getMany(3)); Duplicator d2 = new Duplicator<>(2.5); System.out.println(d2.getMany(4)); } The program prints: [abc, abc, abc] [2.5, 2.5, 2.5, 2.5] import java.util.Random; import java.util.ArrayList; public class Test { public static void main(String[] args) { final Random r = new Random(); System.out.println("Testing the Duplicator class..."); System.out.println("Testing with integer type..."); int element = r.nextInt(100) + 1; System.out.println("Element value: " + element); Duplicator d1 = new Duplicator<>(element); System.out.println("Object created!"); System.out.println("getElement returns " + d1.getElement()); element = r.nextInt(100) + 1; System.out.println("Calling setElement with value " + element); d1.setElement(element); System.out.println("getElement returns " + d1.getElement()); int size = r.nextInt(6) + 2; System.out.println("Calling getMany with value " + size); ArrayList al = d1.getMany(size); System.out.println(al); System.out.println(""); System.out.println("Testing with string type..."); String[] s = "dog cat guinea pig hamster cow sheep chicken guinea pig".split(" "); String sElement = s[r.nextInt(s.length)]; System.out.println("Element value: " + sElement); Duplicator d2 = new Duplicator<>(sElement); System.out.println("Object created!"); System.out.println("getElement returns " + d2.getElement()); sElement = s[r.nextInt(s.length)]; System.out.println("Calling setElement with value " + sElement); d2.setElement(sElement); System.out.println("getElement returns " + d2.getElement()); size = r.nextInt(6) + 2; System.out.println("Calling getMany with value " + size); ArrayList al2 = d2.getMany(size); System.out.println(al2); } } //ADD class Duplicator { // attribute private T singleInput; // constructor public Duplicator(T singleInput){ this.singleInput = singleInput; } // get, set public T getElement() { return this.singleInput; } public void setElement(T singleInput) { this.singleInput = singleInput; } // duplicate this.singleInput // by 'amount' times // in the ArrayList public ArrayList getMany(int amount) { ArrayList list = new ArrayList<>(); for (int i=0; i