### Question:
BeanProvider implements ObjectProvider<T>, Serializable { @Override public T getObject() { try { return beanClass.newInstance(); } catch (InstantiationException e) { throw new ObjectProviderException(e, "%s is not concrete.", beanClass); } catch (IllegalAccessException e) { throw new ObjectProviderException(e, "Constructor for %s is not accessible.", beanClass); } } BeanProvider(Class<? extends T> beanClass); @Override T getObject();  }### Answer:
@Test(expected = ObjectProviderException.class) public void testAbstractBeanClass() { final BeanProvider<Number> p = new BeanProvider<Number>(Number.class); p.getObject(); }
@Test(expected = ObjectProviderException.class) public void testNonAccessibleConstructor() { new BeanProvider<MyBean>(MyBean.class).getObject(); }
@Test(expected = NullPointerException.class) public void testWithNullBeanClass() { final BeanProvider<Object> p = new BeanProvider<Object>(null); p.getObject(); }