### Question:
OptimisticEventStoreService implements EventStore { @Override public ReadableEventStream openStreamForReading(String bucketId, String streamId) throws StreamNotFoundException { return this.openStreamForReading(bucketId, streamId, Long.MAX_VALUE); }  @Override ReadableEventStream openStreamForReading(String bucketId, String streamId); @Override ReadableEventStream openStreamForReading(String bucketId, String streamId, long version); @Override WritableEventStream createStream(String bucketId, String streamId); @Override WritableEventStream openStreamForWriting(
            String bucketId, String streamId, long version); @Override boolean existsStream(String bucketId, String streamId);  }### Answer:
@Test public void test_openStreamForReading() throws Exception { cleanup(); fill(BUCKET_ID, "FOO", 10); ReadableEventStream res = eventStore.openStreamForReading(BUCKET_ID, "FOO"); assertEquals(res.bucketId(), BUCKET_ID); assertEquals(res.streamId(), "FOO"); assertEquals(res.version(), 10); }
@Test(expectedExceptions = StreamNotFoundException.class) public void test_openStreamForReading_nonexistent() throws StreamNotFoundException { cleanup(); eventStore.openStreamForReading("", ""); }
@Test public void test_openStreamForReading_versioned() throws Exception { cleanup(); fill(BUCKET_ID, "FOO", 10); ReadableEventStream res = eventStore.openStreamForReading(BUCKET_ID, "FOO", 6); assertEquals(res.bucketId(), BUCKET_ID); assertEquals(res.streamId(), "FOO"); assertEquals(res.version(), 6); }