public abstract class AbstractNode < SelfNode extends AbstractNode, DualNode extends AbstractNode > { } class SubClass extends AbstractNode { } class A extends AbstractNode { } class B extends AbstractNode { } abstract class Mad < Id extends Comparable, Np extends Mad, Nt extends Mad, SelfNode extends Mad, DualNode extends Mad > { }