default InterfaceDeclaration asInterface(){
  throw new UnsupportedOperationException(String.format("%s is not an interface",this));
}

default InterfaceDeclaration asInterface ( ) { throw new UnsupportedOperationException ( String . format ( "%s is not an interface" , this ) ) ; }
return this as a interfacedeclaration or throw unsupportedoperationexception .
