### Question:
LambdaAccessorFactory implements AccessorFactory { @Override public <BEAN, R, P> Getter<BEAN, R, P> buildGetter(final Field field, ValueProcessor<R, P> valueProcessor) { return new LambdaGetter<>(field, valueProcessor); }  @Override Getter<BEAN, R, P> buildGetter(final Field field, ValueProcessor<R, P> valueProcessor); @Override Getter<BEAN, R, P> buildGetter(final Method method, ValueProcessor<R, P> valueProcessor); @Override Setter<BEAN, R, P> buildSetter(final Field field, ValueProcessor<R, P> valueProcessor); @Override Setter<BEAN, R, P> buildSetter(final Method method, ValueProcessor<R, P> valueProcessor); @Override Setter<BEAN, R, P> buildWither(Method method, ValueProcessor<R, P> valueProcessor);  }### Answer:
@Test public void testGetter() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, String, String> stringGetter = factory.buildGetter(stringGetterMethod, valueProcessor); testBeanOne.setString("StringNewValue"); assertEquals("StringNewValue", stringGetter.getValue(testBeanOne)); final Getter<TestBean, Integer, Integer> integerGetter = factory.buildGetter(integerGetterMethod, valueProcessor); testBeanOne.setInteger(124); assertEquals(124, integerGetter.getValue(testBeanOne).intValue()); final Getter<TestBean, Integer, Integer> intPrimitiveGetterMethodGetter = factory.buildGetter(intPrimitiveGetterMethod, valueProcessor); testBeanOne.setIntPrimitive(87654321); assertEquals(87654321, intPrimitiveGetterMethodGetter.getValue(testBeanOne).intValue()); }
@Test(expected = RuntimeException.class) public void testGetterField() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, Long, Long> longPrimitiveGetter = factory.buildGetter(publicLongPrimitiveField, valueProcessor); testBeanOne.publicLongPrimitive = 123456; longPrimitiveGetter.getValue(testBeanOne); }
@Test(expected = RuntimeException.class) public void testGetterPrivate() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, Integer, Integer> integerPrivateGetter = factory.buildGetter(integerPrivateGetterMethod, valueProcessor); testBeanOne.setInteger(124); assertEquals(124, integerPrivateGetter.getValue(testBeanOne).intValue()); }
@Test(expected = RuntimeException.class) public void testGetterPrivateField() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, String, String> privateStringGetter = factory.buildGetter(privateStringField, valueProcessor); privateStringGetter.getValue(testBeanOne); }
@Test(expected = RuntimeException.class) public void testGetterPublicField() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, Long, Long> longGetter = factory.buildGetter(publicLongField, valueProcessor); testBeanOne.publicLong = 123456l; assertEquals(123456l, longGetter.getValue(testBeanOne).longValue()); }