public static List < Object > getDecoratorLineage ( Object obj ) { List < Object > lineage = Lists . newArrayList ( obj ) ; Object currentObject = obj ; while ( currentObject instanceof Decorator ) { currentObject = ( ( Decorator ) currentObject ) . getDecoratedObject ( ) ; lineage . add ( currentObject ) ; } return Lists . reverse ( lineage ) ; }
Finds the decorator lineage of the given object .