class AbstractReplicatedLogImpl implements ReplicatedLog {

    @Override
    public long removeFrom(long logEntryIndex) {
        int adjustedIndex = adjustedIndex(logEntryIndex);
        if (adjustedIndex < 0 || adjustedIndex >= journal.size()) {
            // physical index should be less than list size and >= 0
            return -1;
        }

        for (int i = adjustedIndex; i < journal.size(); i++) {
            dataSize -= journal.get(i).size();
        }

        journal.subList(adjustedIndex , journal.size()).clear();

        return adjustedIndex;
    }

    protected  AbstractReplicatedLogImpl(long snapshotIndex, long snapshotTerm,
            List<ReplicatedLogEntry> unAppliedEntries, String logContext);
    protected  AbstractReplicatedLogImpl();

}