template < class Element > class Wrapper { Wrapper next; template Wrapper< Element > prev; Element payload; template Wrapper< int > users; Wrapper( Element payload ) { this.payload = payload; next = this; prev = this; } } class UseSelf { static public void main( String[] args ) { template Wrapper< int > inner = new template Wrapper< int >( 1 ); template Wrapper< char > outer = new template Wrapper< char >( 'a' ); inner.users = inner; outer.users = inner; } }