TodoRepositoryImpl implements TodoRepository { @Override public Observable<List<Todo>> getAll() { return Observable.just(Lists.reverse(Todo.listAll(Todo.class))); } TodoRepositoryImpl(Context context); @Override Observable<Todo> createOrUpdate(Todo todo); @Override Observable<Boolean> delete(Long id); @Override Observable<List<Todo>> getAll();  }
@Test public void testGetAll() throws Exception { List<Todo> todoList = mTodoRepository.getAll().toBlocking().single(); assertThat(todoList).hasSize(12); for (int i = 0; i < 12; i++) { assertTrue(todoList.get(i).getId().equals((long) (12 - i))); } }