class ReflectionUtils {

    public static List<Field> getAllDeclaredFields(Class<?> type) {
        List<Field> fields = new ArrayList<Field>();

        for (Class<?> baseType = type; baseType != null; baseType = baseType.getSuperclass()) {
            fields.addAll(Arrays.asList(baseType.getDeclaredFields()));
        }

        return fields;
    }

    private  ReflectionUtils();

}