### Question:
BeanWrapperRowMapper extends DefaultPropertyEditorRegistrar implements RowMapper<T>, BeanFactoryAware, InitializingBean { @Override public void afterPropertiesSet() throws Exception { Assert.state(name != null || type != null, "Either name or type must be provided."); Assert.state(name == null || type == null, "Both name and type cannot be specified together."); }  @Override void setBeanFactory(BeanFactory beanFactory); void setDistanceLimit(int distanceLimit); void setPrototypeBeanName(String name); void setTargetType(Class<? extends T> type); @Override void afterPropertiesSet(); @Override T mapRow(RowSet rs); void setStrict(boolean strict);  }### Answer:
@Test(expected = IllegalStateException.class) public void givenNoNameWhenInitCompleteThenIllegalStateShouldOccur() throws Exception { BeanWrapperRowMapper mapper = new BeanWrapperRowMapper(); mapper.afterPropertiesSet(); }