code: @Nullable
      @SuppressWarnings("unchecked")
      public <T extends Directory> T getFirstDirectoryOfType(@NotNull Class<T> type)
      {
          for (Directory dir : _directories) {
              if (type.isAssignableFrom(dir.getClass()))
                  return (T)dir;
          }
          return null;
      }
docs: Gets the first {@link Directory} of the specified type contained within this metadata collection.
  If no instances of this type are present, <code>null</code> is returned.
  
  @param type the Directory type
  @param <T> the Directory type
  @return the first Directory of type T in this metadata collection, or <code>null</code> if none exist