forked from vengateshm/Java-Coding-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
31 lines (26 loc) · 1008 Bytes
/
Tester.java
File metadata and controls
31 lines (26 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package deepCopy;
import java.util.ArrayList;
import java.util.List;
public class Tester {
public static void main(String[] args) {
List<Insurer> insurerList = new ArrayList<>();
Insurer insurer1 = new Insurer("Insurer1");
Nominee nominee1 = new Nominee("Nominee1");
Nominee nominee2 = new Nominee("Nominee2");
List<Nominee> nominees1 = new ArrayList<>();
nominees1.add(nominee1);
nominees1.add(nominee2);
insurer1.setNominees(nominees1);
Insurer insurer2 = new Insurer("Insurer2");
Nominee nominee3 = new Nominee("Nominee3");
Nominee nominee4 = new Nominee("Nominee4");
List<Nominee> nominees2 = new ArrayList<>();
nominees2.add(nominee3);
nominees2.add(nominee4);
insurer2.setNominees(nominees2);
insurerList.add(insurer1);
insurerList.add(insurer2);
List<Insurer> insurerListCopy = new ArrayList<>(insurerList);
insurerListCopy.size();
}
}