### Question:
SearchSerializer extends LuceneSerializer { @Override public String toField(Path<?> path) { if (path.getAnnotatedElement() != null) { Field fieldAnn = path.getAnnotatedElement().getAnnotation(Field.class); if (fieldAnn != null && fieldAnn.name().length() > 0) { return fieldAnn.name(); } } return super.toField(path); } SearchSerializer(boolean lowerCase, boolean splitTerms); @Override String toField(Path<?> path); static final SearchSerializer DEFAULT; }### Answer:
@Test public void toField() { SearchSerializer serializer = SearchSerializer.DEFAULT; QUser user = new QUser("user"); assertEquals("email", serializer.toField(user.emailAddress)); assertEquals("firstName", serializer.toField(user.firstName)); }