private Transaction insertTransaction(Category category) {
    final Transaction transaction = new Transaction();

    if (category != null) {
      transaction.setCategory(category);
    }

    insert(TransactionsProvider.uriTransactions(), transaction);
    return transaction;
  }
  @Test
  public void deleteDelete_setsItemStateDeletedUndoForTransactions() {
    final Category category = insertCategory();
    insertTransaction(category);

    deleteCategory(category);
    final Cursor cursor = queryTransactionsCursor();

    assertEquals(1, cursor.getCount());
    assertEquals(ModelState.DeletedUndo, Transaction.from(cursor).getModelState());
    IOUtils.closeQuietly(cursor);
  }