### Question:
RosetteAbstractProcessor extends AbstractProcessor { @Override public IngestDocument execute(IngestDocument ingestDocument) throws Exception { if (ingestDocument.hasField(targetField)) { throw new ElasticsearchException("Document already contains data in target field for this ingest " + "processor: " + type); } if (!ingestDocument.hasField(inputField)) { return ingestDocument; } String inputText = ingestDocument.getFieldValue(inputField, String.class); if (Strings.isNullOrEmpty(inputText)) { return ingestDocument; } SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new SpecialPermission()); } processDocument(inputText, ingestDocument); return ingestDocument; } RosetteAbstractProcessor(RosetteApiWrapper rosAPI, String tag, String description, String processorType,
                             String inputField, String targetField); @Override IngestDocument execute(IngestDocument ingestDocument); @Override String getType();  }### Answer:
@Test(expected = ElasticsearchException.class) public void testOverwrite() throws Exception { MockProcessor processor = new MockProcessor(new RosetteApiWrapper(), randomUnicodeOfLength(10), "description", "text", "target"); Map<String, Object> document = new HashMap<>(); document.put("text", "input text"); document.put("target", "don't overwrite me!"); IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); processor.execute(ingestDocument); }