private Type<?> findInterface(final Class<?> theInterface){
  Type<?> theInterfaceType=null;
  LinkedList<Type<?>> types=new LinkedList<Type<?>>();
  types.add(this);
  while (theInterfaceType == null && !types.isEmpty()) {
    Type<?> currentType=types.removeFirst();
    if (theInterface.equals(currentType.getRawType())) {
      theInterfaceType=currentType;
    }
 else     if (!currentType.equals(TypeFactory.TYPE_OF_OBJECT)) {
      types.addAll(Arrays.asList(currentType.getInterfaces()));
      types.add(currentType.getSuperType());
    }
  }
  return theInterfaceType;
}

private Type < ? > findInterface ( final Class < ? > theInterface ) { Type < ? > theInterfaceType = null ; LinkedList < Type < ? > > types = new LinkedList < Type < ? > > ( ) ; types . add ( this ) ; while ( theInterfaceType == null && ! types . isEmpty ( ) ) { Type < ? > currentType = types . removeFirst ( ) ; if ( theInterface . equals ( currentType . getRawType ( ) ) ) { theInterfaceType = currentType ; } else if ( ! currentType . equals ( TypeFactory . TYPE_OF_OBJECT ) ) { types . addAll ( Arrays . asList ( currentType . getInterfaces ( ) ) ) ; types . add ( currentType . getSuperType ( ) ) ; } } return theInterfaceType ; }
locates a particular interface within the type ' s object hierarchy
