EmrModelConfigurator implements PageModelConfigurator, FragmentModelConfigurator { protected Patient patientFromParam(String id) { if (StringUtils.isEmpty(id)) { return null; } try { return patientService.getPatient(Integer.valueOf(id)); } catch (APIAuthenticationException ex) { return null; } }  @Override void configureModel(PageContext pageContext); @Override void configureModel(FragmentContext fragmentContext);  }
@Test public void patientFromParam_shouldHandleEmptyString() { Assert.assertThat(configurator.patientFromParam(""), nullValue()); }