### Question:
Spelling { String swapCharsAt(String word, int pos) { int c = 0; int d = 0; char[] e = new char[word.length()]; while (c < word.length()) { if (c < pos || c > (pos + 1)) e[d++] = word.charAt(c++); else { e[d++] = word.charAt(c + 1); e[d++] = word.charAt(c); c += 2; } } return new String(e); } Spelling(InputStream file);   }### Answer:
@Test public void testTranspose() throws Exception { assertEquals("afrm", spelling.swapCharsAt("farm", 0)); assertEquals("fram", spelling.swapCharsAt("farm", 1)); assertEquals("famr", spelling.swapCharsAt("farm", 2)); }