### Question:
Spelling { String replaceCharAt(String word, int pos, char ch) { int c = 0; char[] e = new char[word.length()]; while (c < word.length()) { if (c != pos) { e[c] = word.charAt(c); } else { e[c] = ch; } c++; } return new String(e); } Spelling(InputStream file);   }### Answer:
@Test public void testReplace() throws Exception { assertEquals("zarm", spelling.replaceCharAt("farm", 0, 'z')); assertEquals("fzrm", spelling.replaceCharAt("farm", 1, 'z')); assertEquals("fazm", spelling.replaceCharAt("farm", 2, 'z')); assertEquals("farz", spelling.replaceCharAt("farm", 3, 'z')); }