@Override
  protected void setUp() throws Exception {
    super.setUp();

    if (!performanceTestsEnabled()) return;

    // Populate documents into the database:
    char[] chars = new char[getSizeOfDocument()];
    Arrays.fill(chars, 'a');
    final String content = new String(chars);

    boolean success =
        database.runInTransaction(
            new TransactionalTask() {
              public boolean run() {
                for (int i = 0; i < getNumberOfDocuments(); i++) {
                  try {
                    Map<String, Object> props = new HashMap<String, Object>();
                    props.put("content", content);
                    Document doc = database.createDocument();
                    doc.putProperties(props);
                  } catch (CouchbaseLiteException e) {
                    Log.e(TAG, "Error when creating a document", e);
                    return false;
                  }
                }
                return true;
              }
            });
    assertTrue(success);
  }