code: boolean isValid(int maxLookAhead, NavMeshQuery navquery, QueryFilter filter) {
          // Check that all polygons still pass query filter.
          int n = Math.min(m_path.size(), maxLookAhead);
          for (int i = 0; i < n; ++i) {
              if (!navquery.isValidPolyRef(m_path.get(i), filter)) {
                  return false;
              }
          }
  
          return true;
      }
docs: Checks the current corridor path to see if its polygon references remain valid. The path can be invalidated if
  there are structural changes to the underlying navigation mesh, or the state of a polygon within the path changes
  resulting in it being filtered out. (E.g. An exclusion or inclusion flag changes.)
  
  @param maxLookAhead
  The number of polygons from the beginning of the corridor to search.
  @param navquery
  The query object used to build the corridor.
  @param filter
  The filter to apply to the operation.
  @return