@Test
void getAllFields() throws Exception {

    assertThrows(IllegalArgumentException.class, () -> Search.getAllFields(null));
    List<Field> fields = Search.getAllFields(BaseReflectiveSearch.class);
    assertEquals(1, fields.size());
    assertEquals(BaseReflectiveSearch.class.getDeclaredField("topField"), fields.get(0));
    fields = Search.getAllFields(InheritedReflectiveSearch.class);
    assertEquals(2, fields.size());
    assertTrue(fields.contains(BaseReflectiveSearch.class.getDeclaredField("topField")));
    assertTrue(fields.contains(InheritedReflectiveSearch.class.getDeclaredField("bottomField")));
    fields = Search.getAllFields(OverridenReflectiveSearch.class);
    assertEquals(2, fields.size());
    assertTrue(fields.contains(BaseReflectiveSearch.class.getDeclaredField("topField")));
    assertTrue(fields.contains(InheritedReflectiveSearch.class.getDeclaredField("bottomField")));
}