BeanUtils { public static Vector<Field> getAllFields(Class clazz) { return getAllFieldsRec(clazz, new Vector<>()).stream().filter(field -> !field.getName().equals("this$0")) .collect(Collectors.toCollection(Vector::new)); } private  BeanUtils(); static void swapper(Object o, String key, Object value, String... ignores); static LinkedList<String> columns2Row(List<T> objList, String[] fields,
                                                     boolean isLongTail, boolean forDruid, Object... ignores); static LinkedList<String> columns2Row(List<T> objList, String[] fields,
                                                     Class parentClass, boolean isLongTail,
                                                     boolean forDruid, Object... ignores); static LinkedList<String> column2Row(T obj, String[] fields, boolean isLongTail,
                                                    boolean forDruid, Object... ignores); static LinkedList<String> column2Row(T obj, String[] fields, Class parentClass,
                                                    boolean isLongTail, boolean forDruid, Object... ignores); static LinkedList<String> columns2Row(List<T> objList, Set<Field> head,
                                                     Set<Field> tail, boolean forDruid); static LinkedList<String> column2Row(T obj, Set<Field> head, Set<Field> tail, boolean forDruid); static void dealWithTail(T obj, Set<Field> tail, LinkedList<String> rows, JSONObject jsonObject); static void dealWithTail4Druid(T obj, Set<Field> tail, LinkedList<String> rows, JSONObject jsonObject); static Vector<Field> getFields(Class<?> clazz, String className); static Vector<Field> getAllFields(Class clazz);  }
@Test public void getAllFieldsTest() { assertEquals(5, BeanUtils.getFields(BeanB.class, BeanB.class.getName()).size()); assertEquals(5, BeanUtils.getAllFields(BeanB.class).size()); }