code: public static String[] extractNames(Scope[] scopes)
      {
          if (scopes == null)
          {
              return null;
          }
  
          // Create an array for scope names.
          String[] names = new String[scopes.length];
  
          // For each scope.
          for (int i = 0; i < scopes.length; ++i)
          {
              // Scope at the index.
              Scope scope = scopes[i];
  
              // Extract the scope name.
              names[i] = (scope == null) ? null : scope.getName();
          }
  
          // Extracted scope names.
          return names;
      }
docs: Extract scope names.
  
  @param scopes
  Scopes.
  
  @return
  Scope names. If {@code scopes} is {@code null},
  {@code null} is returned.