Person { public String getCarInsuranceName() { if (this.car.isPresent()) { Optional<Insurance> insurance = this.car.get().getInsurance(); if (insurance.isPresent()) { Optional<String> name = insurance.get().getName(); if(name.isPresent()) return name.get(); } } return "Unknown"; }  String getCarInsuranceName();  }
@Test public void testCarInsuranceName() throws IOException { Person p = new Person(); assertEquals("Unknown", p.getCarInsuranceName()); }