### Question:
PageFragmentEnricher extends AbstractSearchContextEnricher { @Override public void enrich(final SearchContext searchContext, Object target) { List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target); for (Field field : fields) { GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext) .getGrapheneContext(); final SearchContext localSearchContext; if (grapheneContext == null) { grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations())); localSearchContext = grapheneContext.getWebDriver(SearchContext.class); } else { localSearchContext = searchContext; } if (isPageFragmentClass(field.getType(), target)) { setupPageFragment(localSearchContext, target, field); } else { try { if (field.getType().isAssignableFrom(List.class) && isPageFragmentClass(getListType(field), target)) { setupPageFragmentList(localSearchContext, target, field); } } catch (ClassNotFoundException e) { throw new PageFragmentInitializationException(e.getMessage(), e); } } } } PageFragmentEnricher();  PageFragmentEnricher(Instance<GrapheneConfiguration> configuration); @Override void enrich(final SearchContext searchContext, Object target); @Override Object[] resolve(SearchContext searchContext, Method method, Object[] resolvedParams); static T createPageFragment(Class<T> clazz, final WebElement root); @Override int getPrecedence();  }### Answer:
@Test public void testMissingNoArgConstructor() { NoArgConstructorTest target = new NoArgConstructorTest(); getGrapheneEnricher().enrich(target); Assert.assertNull(target.pageFragment); }
@Test public void testTooManyRoots() { thrown.expect(PageFragmentInitializationException.class); getGrapheneEnricher().enrich(new TooManyRootsTest()); }
@Test(expected = PageFragmentInitializationException.class) public void testAbstractType() { AbstractTypeTest target = new AbstractTypeTest(); getGrapheneEnricher().enrich(target); Assert.assertNotNull(target.pageFragment); }