// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java
// @NoArgsConstructor
// public class PositionFactory implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Builds a dummy position.
//    * @return Dummy position.
//    */
//   public Position build() {
//     return new Position(-1, -1);
//   }
// 
//   /**
//    * Builds a position vector for the standard, Levenshtein algorihtm.
//    * @param termIndex Current index of the spelling candidate.
//    * @param numErrors Number of accumulated errors at index {@code termIndex}.
//    * @return New position vector having index {@code termIndex} and error
//    *   {@code numErrors}.
//    */
//   public Position build(final int termIndex, final int numErrors) {
//     return new Position(termIndex, numErrors);
//   }
// 
//   /**
//    * Builds a position vector for the transposition and merge-and-split,
//    * Levenshtein algorihtms.
//    * @param termIndex Current index of the spelling candidate.
//    * @param numErrors Number of accumulated errors at index {@code termIndex}.
//    * @param isSpecial Either {@code 1} or {@code 0}, depending on whether the
//    *   position is a special case (numErrors.g. a transposition position).
//    * @return New position vector having index {@code termIndex}, error
//    *   {@code numErrors}, and special marker {@code isSpecial}.
//    */
//   public Position build(final int termIndex, final int numErrors, final boolean isSpecial) {
//     if (isSpecial) {
//       return new SpecialPosition(termIndex, numErrors);
//     }
// 
//     return new Position(termIndex, numErrors);
//   }
// }
// 
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/StateFactory.java
// public class StateFactory implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Builds a new, Levenshtein state with the given position vectors.
//    * @param positions Array of position vectors to link into the state.
//    * @return New state having the position vectors.
//    */
//   public State build(final Position... positions) {
//     final State state = new State();
// 
//     Position prev = null;
//     for (final Position curr : positions) {
//       state.insertAfter(prev, curr);
//       prev = curr;
//     }
// 
//     return state;
//   }
// }
// 
// Path: src/test/java/com/github/liblevenshtein/assertion/StandardPositionTransitionFunctionAssertions.java
// public static StandardPositionTransitionFunctionAssertions assertThat(
//     final StandardPositionTransitionFunction actual) {
//   return new StandardPositionTransitionFunctionAssertions(actual);
// }


import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.github.liblevenshtein.transducer.factory.PositionFactory;
import com.github.liblevenshtein.transducer.factory.StateFactory;
import static com.github.liblevenshtein.assertion.StandardPositionTransitionFunctionAssertions.assertThat;

  @BeforeTest
  public void setUp() {
    transition.stateFactory(stateFactory);
    transition.positionFactory(positionFactory);
  }

  @Test
  public void testOf() {
    i = 0; e = 0;
    check(1 + i, e, true, false, true, false);
    check(i, 1 + e, 1 + i, 1 + e, 1 + 1 + i, 1 + e, false, true, false, true);
    check(i, 1 + e, 1 + i, 1 + e, false, false, false, false);

    i = W - 1;
    check(1 + i, e, true, true, true, true);
    check(i, 1 + e, 1 + i, 1 + e, false, false, false, false);

    i = W;
    check(W, 1 + e, true, true, true, true);

    i = 2; e = N;
    check(1 + i, N, true, true, true, true);
    check(false, false, false, false);

    i = W;
    check(true, true, true, true);
  }

  private void check(final boolean... characteristicVector) {
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/PositionFactory.java
// @NoArgsConstructor
// public class PositionFactory implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Builds a dummy position.
//    * @return Dummy position.
//    */
//   public Position build() {
//     return new Position(-1, -1);
//   }
// 
//   /**
//    * Builds a position vector for the standard, Levenshtein algorihtm.
//    * @param termIndex Current index of the spelling candidate.
//    * @param numErrors Number of accumulated errors at index {@code termIndex}.
//    * @return New position vector having index {@code termIndex} and error
//    *   {@code numErrors}.
//    */
//   public Position build(final int termIndex, final int numErrors) {
//     return new Position(termIndex, numErrors);
//   }
// 
//   /**
//    * Builds a position vector for the transposition and merge-and-split,
//    * Levenshtein algorihtms.
//    * @param termIndex Current index of the spelling candidate.
//    * @param numErrors Number of accumulated errors at index {@code termIndex}.
//    * @param isSpecial Either {@code 1} or {@code 0}, depending on whether the
//    *   position is a special case (numErrors.g. a transposition position).
//    * @return New position vector having index {@code termIndex}, error
//    *   {@code numErrors}, and special marker {@code isSpecial}.
//    */
//   public Position build(final int termIndex, final int numErrors, final boolean isSpecial) {
//     if (isSpecial) {
//       return new SpecialPosition(termIndex, numErrors);
//     }
// 
//     return new Position(termIndex, numErrors);
//   }
// }
// 
// Path: src/main/java/com/github/liblevenshtein/transducer/factory/StateFactory.java
// public class StateFactory implements Serializable {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Builds a new, Levenshtein state with the given position vectors.
//    * @param positions Array of position vectors to link into the state.
//    * @return New state having the position vectors.
//    */
//   public State build(final Position... positions) {
//     final State state = new State();
// 
//     Position prev = null;
//     for (final Position curr : positions) {
//       state.insertAfter(prev, curr);
//       prev = curr;
//     }
// 
//     return state;
//   }
// }
// 
// Path: src/test/java/com/github/liblevenshtein/assertion/StandardPositionTransitionFunctionAssertions.java
// public static StandardPositionTransitionFunctionAssertions assertThat(
//     final StandardPositionTransitionFunction actual) {
//   return new StandardPositionTransitionFunctionAssertions(actual);
// }


// Path: src/test/java/com/github/liblevenshtein/transducer/StandardPositionTransitionFunctionTest.java
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.github.liblevenshtein.transducer.factory.PositionFactory;
import com.github.liblevenshtein.transducer.factory.StateFactory;
import static com.github.liblevenshtein.assertion.StandardPositionTransitionFunctionAssertions.assertThat;


  @BeforeTest
  public void setUp() {
    transition.stateFactory(stateFactory);
    transition.positionFactory(positionFactory);
  }

  @Test
  public void testOf() {
    i = 0; e = 0;
    check(1 + i, e, true, false, true, false);
    check(i, 1 + e, 1 + i, 1 + e, 1 + 1 + i, 1 + e, false, true, false, true);
    check(i, 1 + e, 1 + i, 1 + e, false, false, false, false);

    i = W - 1;
    check(1 + i, e, true, true, true, true);
    check(i, 1 + e, 1 + i, 1 + e, false, false, false, false);

    i = W;
    check(W, 1 + e, true, true, true, true);

    i = 2; e = N;
    check(1 + i, N, true, true, true, true);
    check(false, false, false, false);

    i = W;
    check(true, true, true, true);
  }

  private void check(final boolean... characteristicVector) {
    assertThat(transition)