### Question:
MethodHandlerAccessorFactory implements AccessorFactory { @Override public <BEAN, R, P> Getter<BEAN, R, P> buildGetter(final Field field, ValueProcessor<R, P> valueProcessor) { return new MethodHandlerGetter<>(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 testGetterField() { final TestBean testBeanOne = new TestBean(); final Getter<TestBean, Long, Long> longPrimitiveGetter = factory.buildGetter(publicLongPrimitiveField, valueProcessor); testBeanOne.publicLongPrimitive = 123456; assertEquals( testBeanOne.publicLongPrimitive, longPrimitiveGetter.getValue(testBeanOne).longValue()); }
@Test 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 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()); }
@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 public void testStaticGetter() throws Exception { final Method staticMethod = ImmutableFoobarValue.class.getMethod("builder"); assertNotNull(staticMethod); final Getter<ImmutableFoobarValue, ImmutableFoobarValue.Builder, ImmutableFoobarValue.Builder> staticGetter = factory.buildGetter(staticMethod, valueProcessor); final Builder result = staticGetter.getValue(null); assertNotNull(result); }