SqlitePaxosStateLog implements PaxosStateLog<V> { @Override public byte[] readRound(long seq) { return execute(dao -> dao.readRound(namespace, useCase, seq)); } private  SqlitePaxosStateLog(NamespaceAndUseCase namespaceAndUseCase, Jdbi jdbi); static PaxosStateLog<V> create(
            NamespaceAndUseCase namespaceAndUseCase,
            DataSource dataSource); @Override void writeRound(long seq, V round); @Override void writeBatchOfRounds(Iterable<PaxosRound<V>> rounds); @Override byte[] readRound(long seq); @Override long getLeastLogEntry(); @Override long getGreatestLogEntry(); @Override void truncate(long toDeleteInclusive);  }
@Test public void readingNonExistentRoundReturnsNull() throws IOException { assertThat(stateLog.readRound(10L)).isNull(); }
@Test public void canWriteAndRetrieveAValue() throws IOException { long round = 12L; PaxosValue paxosValue = writeValueForRound(round); assertThat(PaxosValue.BYTES_HYDRATOR.hydrateFromBytes(stateLog.readRound(round))).isEqualTo(paxosValue); }
@Test public void canOverwriteSequences() throws IOException { writeValueForRound(5L); PaxosValue newEntry = writeValueForRound(5L); assertThat(PaxosValue.BYTES_HYDRATOR.hydrateFromBytes(stateLog.readRound(5L))).isEqualTo(newEntry); }