Document { public ByteBuffer getData() { return data.asReadOnlyBuffer(); } Document(String documentId, byte[] data, Object context, Instant createTime);  Document(String documentId, String operationId, CharSequence data, Object context, Instant createTime); private  Document(String documentId, String operationId, ByteBuffer data, Object context, Instant createTime); void setQueueInsertTime(Instant queueInsertTime); Instant getQueueInsertTime(); CharSequence getDataAsString(); Object getContext(); String getDocumentId(); ByteBuffer getData(); int size(); Instant createTime(); String getOperationId(); @Override String toString();  }
@Test(expected = ReadOnlyBufferException.class) public void notMutablePutTest() { Document document = new Document("id", null, "data", null, Clock.systemUTC().instant()); document.getData().put("a".getBytes()); }
@Test(expected = ReadOnlyBufferException.class) public void notMutableCompactTest() { Document document = new Document("id", null, "data", null, Clock.systemUTC().instant()); document.getData().compact(); }