private void internalTestFindLegacyRecords(Database db) throws Exception {
    MartusCrypto security = MockMartusSecurity.createClient();

    UniversalId uid = UniversalIdForTesting.createDummyUniversalId();
    DatabaseKey legacyKey = DatabaseKey.createLegacyKey(uid);
    db.writeRecord(legacyKey, smallString);
    InputStream inLegacy = db.openInputStream(legacyKey, security);
    assertNotNull("legacy not found?", inLegacy);
    inLegacy.close();

    InputStream inDraft = db.openInputStream(legacyKey, security);
    assertNotNull("draft not found?", inDraft);
    inDraft.close();

    DatabaseKey sealedKey = DatabaseKey.createSealedKey(uid);
    InputStream inSealed = db.openInputStream(sealedKey, security);
    assertNotNull("sealed not found?", inSealed);
    inSealed.close();

    db.deleteAllData();
  }