elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/taxonomy/TaxonomyNodeUtils.java
public static <T extends ElkEntity, I extends ElkEntity, TN extends GenericTypeNode<T, I, TN, IN>, IN extends GenericInstanceNode<T, I, TN, IN>>
			Set<? extends IN> getAllInstanceNodes(final GenericTypeNode<T, I, TN, IN> node) {
		return TaxonomyNodeUtils.collectFromAllReachable(
				node.getDirectSubNodes(),
				node.getDirectInstanceNodes(),
				new Operations.Functor<GenericTypeNode<T, I, TN, IN>, Set<? extends GenericTypeNode<T, I, TN, IN>>>() {
					@Override
					public Set<? extends TN> apply(final GenericTypeNode<T, I, TN, IN> node) {
						return node.getDirectSubNodes();
					}
				},
				new Operations.Functor<GenericTypeNode<T, I, TN, IN>, Set<? extends IN>>() {
					@Override
					public Set<? extends IN> apply(final GenericTypeNode<T, I, TN, IN> node) {
						return node.getDirectInstanceNodes();
					}
				});
	}
public static <T extends ElkEntity, I extends ElkEntity, TN extends GenericTypeNode<T, I, TN, IN>, IN extends GenericInstanceNode<T, I, TN, IN>>
			Set<? extends IN> getAllInstanceNodes(final GenericTypeNode<T, I, TN, IN> node) {
		return TaxonomyNodeUtils.collectFromAllReachable(
				node.getDirectSubNodes(),
				node.getDirectInstanceNodes(),
				new Operations.Functor<GenericTypeNode<T, I, TN, IN>, Set<? extends GenericTypeNode<T, I, TN, IN>>>() {
					@Override
					public Set<? extends TN> apply(final GenericTypeNode<T, I, TN, IN> node) {
						return node.getDirectSubNodes();
					}
				},
				new Operations.Functor<GenericTypeNode<T, I, TN, IN>, Set<? extends IN>>() {
					@Override
					public Set<? extends IN> apply(final GenericTypeNode<T, I, TN, IN> node) {
						return node.getDirectInstanceNodes();
					}
				});
	}
public static < T extends ElkEntity , I extends ElkEntity , TN extends GenericTypeNode < T , I , TN , IN > , IN extends GenericInstanceNode < T , I , TN , IN > > Set < ? extends IN > getAllInstanceNodes ( final GenericTypeNode < T , I , TN , IN > node ) { return TaxonomyNodeUtils . collectFromAllReachable ( node . getDirectSubNodes ( ) , node . getDirectInstanceNodes ( ) , new Operations . Functor < GenericTypeNode < T , I , TN , IN > , Set < ? extends GenericTypeNode < T , I , TN , IN > > > ( ) { @ Override public Set < ? extends TN > apply ( final GenericTypeNode < T , I , TN , IN > node ) { return node . getDirectSubNodes ( ) ; } } , new Operations . Functor < GenericTypeNode < T , I , TN , IN > , Set < ? extends IN > > ( ) { @ Override public Set < ? extends IN > apply ( final GenericTypeNode < T , I , TN , IN > node ) { return node . getDirectInstanceNodes ( ) ; } } ) ; }
Returns all instance nodes of the specified type node and all its
sub-nodes.

@param node
The type node whose instances should be returned.
@return all instance nodes of the specified type node and all its
sub-nodes.
Returns all instance nodes of the specified type node and all its sub - nodes .