### Question:
EditSequence { public int cost(String s1, String s2, EdOpWeight w) { int added = 0; int n1 = 0; int n2 = 0; for (EdOp op : ops) { switch (op) { case INSERT: added += w.ins(s2.charAt(n2)); ++n2; break; case SUBSTITUTE: added += w.sub(s1.charAt(n1), s2.charAt(n2)); ++n1; ++n2; break; case DELETE: added += w.del(s1.charAt(n1)); ++n1; break; case KEEP: ++n1; ++n2; break; } } return added; } EditSequence();  EditSequence(int initialCapacity);  EditSequence(String first, String second, EdOpWeight w);  EditSequence(String s1, String s2, EdOpWeight w, int chunkLen);  EditSequence(TokenArray first, TokenArray second);  EditSequence(TokenArray a1, TokenArray a2, int chunkLen); EdOp get(int pos); final void add(EdOp op); final void append(EditSequence other); EditSequence head(int len); int size(); int length(); final int shift1(); final int shift2(); @Override String toString(); BiCounter<Character, EdOp> stats(String s1, String s2); BiCounter<Character, EdOp> stats(String s1, String s2, EdOpWeight w); int cost(String s1, String s2, EdOpWeight w); static void main(String[] args);  }### Answer:
@Test public void testCost() { System.out.println("cost"); EditSequence instance = new EditSequence("acb", "a b", new OcrOpWeight()); int expResult = 2; int result = instance.length(); assertEquals(expResult, result); }