| 69 | } |
| 70 | |
| 71 | public static class Person implements Named { |
| 72 | private final String name; |
| 73 | private List<Dog> dogs; |
| 74 | private List<Cat> cats; |
| 75 | private List<Named> friends; |
| 76 | |
| 77 | public Person(String name) { |
| 78 | this(name, Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); |
| 79 | } |
| 80 | |
| 81 | public Person(String name, List<Cat> cats, List<Dog> dogs, List<Named> friends) { |
| 82 | this.name = name; |
| 83 | this.dogs = dogs; |
| 84 | this.cats = cats; |
| 85 | this.friends = friends; |
| 86 | } |
| 87 | |
| 88 | public List<Object> getPets() { |
| 89 | List<Object> pets = new ArrayList<>(); |
| 90 | pets.addAll(cats); |
| 91 | pets.addAll(dogs); |
| 92 | return pets; |
| 93 | } |
| 94 | |
| 95 | @Override |
| 96 | public String getName() { |
| 97 | return name; |
| 98 | } |
| 99 | |
| 100 | public List<Named> getFriends() { |
| 101 | return friends; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | public static Cat garfield = new Cat("Garfield", false); |
| 106 | public static Dog odie = new Dog("Odie", true); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…