code: public static IScope findApplication(IScope from) {
          IScope current = from;
          while (current.hasParent() && !current.getType().equals(ScopeType.APPLICATION)) {
              current = current.getParent();
          }
          return current;
      }
docs: Returns the application scope for specified scope. Application scope has depth of 1 and has no parent.
  
  See
  
  <pre>
  isApp
  </pre>
  
  method for details.
  
  @param from
  Scope to find application for
  @return Application scope.