Introduce Null Object
You have repeated checks for a null value.
Replace the null value with a null object.
if (customer == null) plan = BillingPlan.basic(); else plan = customer.getPlan();

For more inforamtion see page 260 of Refactoring
You have repeated checks for a null value.
Replace the null value with a null object.
if (customer == null) plan = BillingPlan.basic(); else plan = customer.getPlan();

For more inforamtion see page 260 of Refactoring