### Question:
Documents { public static void setId(Object document, String id) { DocumentAccessor d = getAccessor(document); if (d.hasIdMutator()) { d.setId(document, id); } }  static void registerAccessor(Class<?> documentType, DocumentAccessor accessor); static String getId(Object document); static void setId(Object document, String id); static String getRevision(Object document); static void setRevision(Object document, String rev); static boolean isNew(Object document);  }### Answer:
@Test public void given_id_in_constructor_when_setting_id_should_fail_silent() { Documents.setId(constDoc, "new_id"); }
@Test public void should_handle_setId_on_map() { Documents.setId(mapDoc, "new_id"); assertEquals("new_id", mapDoc.get("_id")); }
@Test public void should_handle_setId_on_JsonNode() { Documents.setId(nodeDoc, "new_id"); assertEquals("new_id", nodeDoc.get("_id").textValue()); }