public static LogEntry mockEntry(final int index, final int term, final int dataSize) {
        LogEntry entry = new LogEntry(EnumOutter.EntryType.ENTRY_TYPE_NO_OP);
        entry.setId(new LogId(index, term));
        if (dataSize > 0) {
            byte[] bs = new byte[dataSize];
            ThreadLocalRandom.current().nextBytes(bs);
            entry.setData(ByteBuffer.wrap(bs));
        }
        return entry;
    }
Test helper

@author boyan (boyan@alibaba-inc.com)
<p>
2018-Apr-11 10:16:07 AM
jraft-core/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java