public static <T> List<Field> getDeclaredFields(T type) {
        return new ArrayList<>(asList(type.getClass().getDeclaredFields()));
    }
public static < T > List < Field > getDeclaredFields ( T type ) { return new ArrayList < > ( asList ( type . getClass ( ) . getDeclaredFields ( ) ) ) ; }
Get declared fields of a given type.

@param type the type to introspect
@param <T>  the actual type to introspect
@return list of declared fields