@Test
public void getAllFieldsForClassWithBarWithoutFoo() throws NoSuchFieldException, SecurityException {

    Set<Field> barFields = ReflectUtil.getAllFieldsForClass(Bar.class, new Class<?>[] {Foo.class});
    Assert.assertNotNull(barFields);
    Assert.assertTrue(barFields.contains(Bar.class.getDeclaredField("barField")));
    Assert.assertTrue(barFields.contains(Bar.class.getDeclaredField("barIntField")));
}