### Question:
ExtrasHandler { void addToExtras(List<Person> persons) { persons.forEach(p -> { p.setRelationshipStatus(null); p.clearFamilyID(); }); this.extras.addAll(persons); persons.clear(); } ExtrasHandler(List<IndRecord> indRecords, Random random);   }### Answer:
@Test public void testAddToExtras() throws NoSuchFieldException, IllegalAccessException { int startingSize = extrasHandler.remainingExtras(); Person p = new Person(); p.setRelationshipStatus(RelationshipStatus.RELATIVE); p.setAgeRange(AgeRange.A25_39); p.setSex(Sex.Male); extrasHandler.addToExtras(new ArrayList<>(Collections.singleton(p))); Assert.assertTrue("New person added to extras - extras increments by one", startingSize + 1 == extrasHandler.remainingExtras()); Field field = ExtrasHandler.class.getDeclaredField("extras"); field.setAccessible(true); List<Person> extras = (List<Person>) field.get(extrasHandler); Person lastAddedToExtras = extras.get(extras.size() - 1); Assert.assertEquals("New person added to extra - age", lastAddedToExtras.getAgeRange(), AgeRange.A25_39); Assert.assertEquals("New person added to extra - sex", lastAddedToExtras.getSex(), Sex.Male); Assert.assertEquals("New person added to extra - relationship status", lastAddedToExtras.getRelationshipStatus(), null); }