SliceReferenceFieldProcessor implements FieldProcessor { @Override public boolean accepts(final Resource resource, final Field field) { Class<?> type = field.getType(); return type != String.class && !type.isPrimitive() && field.isAnnotationPresent(SliceReference.class); }  @Override boolean accepts(final Resource resource, final Field field); @Override Object mapResourceToField(final Resource resource, final ValueMap valueMap, final Field field,
			final String propertyName);  }
@Test public void testAcceptString() throws SecurityException, NoSuchFieldException { Field field = TestObject.class.getDeclaredField("stringField"); boolean result = processor.accepts(resource, field); Assert.assertFalse("String field should not be acceptable", result); }
@Test public void testAcceptPrimitive() throws SecurityException, NoSuchFieldException { Field field = TestObject.class.getDeclaredField("booleanField"); boolean result = processor.accepts(resource, field); Assert.assertFalse("Primitive field should not be acceptable", result); field = TestObject.class.getDeclaredField("intField"); result = processor.accepts(resource, field); Assert.assertFalse("Primitive field should not be acceptable", result); }
@Test public void testAcceptAnnotated() throws SecurityException, NoSuchFieldException { Field field = TestObject.class.getDeclaredField("fieldAnnotatedWithSliceReference"); boolean result = processor.accepts(resource, field); Assert.assertTrue("Annotated field should be acceptable", result); }