code: @SuppressWarnings("unchecked")
      @Override
      protected boolean doFirst(ListIterator<Step<?, ?>> stepIterator, Step<?, ?> step, MutableInt pathCount) {
          if (step instanceof SelectOneStep) {
              if (stepIterator.hasNext()) {
                  stepIterator.next();
                  return true;
              } else {
                  return false;
              }
          }
          if (!(step instanceof VertexStep ||
                  step instanceof EdgeVertexStep ||
                  step instanceof ChooseStep ||
                  step instanceof OptionalStep)) {
              return false;
          }
          if (step instanceof OptionalStep) {
              if (unoptimizableOptionalStep((OptionalStep<?>) step)) {
                  return false;
              }
          }
          if (step instanceof ChooseStep) {
              if (unoptimizableChooseStep((ChooseStep<?, ?, ?>) step)) {
                  return false;
              }
          }
          this.sqlgStep = constructSqlgStep(step);
          TraversalHelper.insertBeforeStep(this.sqlgStep, step, this.traversal);
          return true;
      }
docs: EdgeOtherVertexStep can not be optimized as the direction information is lost.
  
  @param stepIterator The steps to iterate. Unused for the VertexStrategy
  @param step         The current step.
  @param pathCount    The path count.
  @return true if the optimization can continue else false.