@Test
  public void testNullField() {

    String[] fields = new String[] {"s", "o", "s2"};
    ReflectionLuceneSerializer mapper = new ReflectionLuceneSerializer(Type2.class, fields);

    Type2 type2 = new Type2("a", 1, 2L, 3.0, 4.0f, null);

    Document doc = invokeSerializer(mapper, type2, fields);

    assertEquals(1, doc.getFields().size());
    assertEquals("a", doc.getField("s").stringValue());
    assertNull(doc.getField("s2"));
  }
Unit test of the ReflectionFieldMapperClass. Tests that all field types are mapped correctly.
geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java