protected List<Field> allFields(final Class<?> c){
  List<Field> l=fieldsCache.get(c);
  if (l == null) {
    l=new LinkedList<Field>();
    final Field[] fields=c.getDeclaredFields();
    addAll(l,fields);
    Class<?> sc=c;
    while ((sc=sc.getSuperclass()) != Object.class && sc != null) {
      addAll(l,sc.getDeclaredFields());
    }
    fieldsCache.putIfAbsent(c,l);
  }
  return l;
}

protected List < Field > allFields ( final Class < ? > c ) { List < Field > l = fieldsCache . get ( c ) ; if ( l == null ) { l = new LinkedList < Field > ( ) ; final Field [ ] fields = c . getDeclaredFields ( ) ; addAll ( l , fields ) ; Class < ? > sc = c ; while ( ( sc = sc . getSuperclass ( ) ) != Object . class && sc != null ) { addAll ( l , sc . getDeclaredFields ( ) ) ; } fieldsCache . putIfAbsent ( c , l ) ; } return l ; }
reflection utils , override this to choose which fields to clone
