private static List < Class < ? > > computeAncestry ( final Class < ? > c ) { List < Class < ? > > result = new ArrayList < Class < ? > > ( ) ; result . add ( Object . class ) ; computeAncestry ( c , result ) ; Collections . reverse ( result ) ; return unmodifiableList ( new ArrayList < Class < ? > > ( result ) ) ; }
Starting with children and going back to parents