ValidationUtils.rejectIfEmpty does not stop the code flow (does not throw error). So even if dosingType is null, code will reach here. So we need a guard clause to guard against NullPointerException.