### Question:
MutatableAction extends IndexAction { public void replaceRecord(final String rowId, final Record record) { UpdateRow updateRow = getUpdateRow(rowId); updateRow.replaceRecord(record); } MutatableAction(ShardContext context); void deleteRow(final String rowId); void replaceRow(final Row row); void deleteRecord(final String rowId, final String recordId); void replaceRecord(final String rowId, final Record record); void appendColumns(final String rowId, final Record record); void replaceColumns(final String rowId, final Record record); @Override void performMutate(IndexSearcherCloseable searcher, IndexWriter writer); static Term createRowId(String id); static Term createRecordId(String id); @Override void doPreCommit(IndexSearcherCloseable indexSearcher, IndexWriter writer); @Override void doPostCommit(IndexWriter writer); @Override void doPreRollback(IndexWriter writer); @Override void doPostRollback(IndexWriter writer); void mutate(RowMutation mutation); void mutate(List<RowMutation> mutations); static List<RowMutation> reduceMutates(List<RowMutation> mutations);  }### Answer:
@Test public void testReplaceRecord() throws IOException { RAMDirectory directory = new RAMDirectory(); DirectoryReader reader = getIndexReader(directory); IndexWriter writer = new IndexWriter(directory, _conf.clone()); assertEquals(0, reader.numDocs()); Row row = genRow(); List<Column> cols = new ArrayList<Column>(); cols.add(new Column("n", "v")); row.addToRecords(new Record("1", "fam", cols)); _action.replaceRow(row); _action.performMutate(getSearcher(reader, directory), writer); reader = commitAndReopen(reader, writer); assertEquals(2, reader.numDocs()); cols.add(new Column("n2", "v2")); Record record = new Record("1", "fam", cols); _action.replaceRecord(row.getId(), record); _action.performMutate(getSearcher(reader, directory), writer); reader = commitAndReopen(reader, writer); assertEquals(2, reader.numDocs()); IndexSearcher searcher = new IndexSearcher(reader); TopDocs topDocs = searcher.search(new TermQuery(new Term(BlurConstants.ROW_ID, row.getId())), 10); Document doc2 = searcher.doc(topDocs.scoreDocs[1].doc); List<IndexableField> fields = doc2.getFields(); assertEquals(fields.size(), 5); String value = doc2.get("fam.n2"); assertEquals("v2", value); }