### Question:
LedgerEntryImpl implements LedgerEntry { public static LedgerEntryImpl duplicate(LedgerEntry entry) { return create( entry.getLedgerId(), entry.getEntryId(), entry.getLength(), entry.getEntryBuffer().retainedSlice()); } private  LedgerEntryImpl(Handle<LedgerEntryImpl> handle); static LedgerEntryImpl create(long ledgerId,
                                         long entryId); static LedgerEntryImpl create(long ledgerId,
                                         long entryId,
                                         long length,
                                         ByteBuf buf); static LedgerEntryImpl duplicate(LedgerEntry entry); void setEntryId(long entryId); void setLength(long length); void setEntryBuf(ByteBuf buf); @Override long getLedgerId(); @Override long getEntryId(); @Override long getLength(); @Override byte[] getEntryBytes(); @Override ByteBuf getEntryBuffer(); @Override ByteBuffer getEntryNioBuffer(); @Override LedgerEntryImpl duplicate(); @Override void close();  }### Answer:
@Test public void testDuplicate() { LedgerEntryImpl duplicatedEntry = LedgerEntryImpl.duplicate(entryImpl); assertEquals(2, dataBuf.refCnt()); assertEquals(ledgerId, duplicatedEntry.getLedgerId()); assertEquals(entryId, duplicatedEntry.getEntryId()); assertEquals(length, duplicatedEntry.getLength()); assertArrayEquals(dataBytes, duplicatedEntry.getEntryBytes()); duplicatedEntry.close(); assertEquals(1, dataBuf.refCnt()); }