CheckedDatastoreReaderWriter { Entity put(FullEntity<?> entity) throws IOException { return call(() -> rw.put(entity)); } CheckedDatastoreReaderWriter(DatastoreReaderWriter rw);   }
@Test public void putShouldThrowCheckedException() throws IOException { when(rw.put(entity1)).thenThrow(CAUSE); exception.expect(IOException.class); exception.expectCause(is((Throwable) CAUSE)); sut.put(entity1); }
@Test public void put() throws IOException { when(rw.put(entity1)).thenReturn(entity1); assertThat(sut.put(entity1), is(entity1)); verify(rw).put(entity1); }