@Test public void testCarInsuranceName() throws IOException { Person p = new Person(); assertEquals("Unknown", p.getCarInsuranceName()); }
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"; }
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"; } }
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"; }  }
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(); }
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();  }