@Test
  public void testCorruptedCollectDanglingRecords() throws Exception {
    journal.open();
    Uid gtrid1 = UidGenerator.generateUid();
    Uid gtrid2 = UidGenerator.generateUid();

    assertEquals(0, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTING, gtrid1, csvToSet("name1,name2,name3"));
    assertEquals(1, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid1, csvToSet("name1"));
    assertEquals(1, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid1, csvToSet("name3"));
    assertEquals(1, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid1, csvToSet("name4"));
    assertEquals(1, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid1, csvToSet("name2"));
    assertEquals(0, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid2, csvToSet("name1"));
    assertEquals(0, journal.collectDanglingRecords().size());
  }
  @Test
  public void testSimpleCollectDanglingRecords() throws Exception {
    journal.open();
    Uid gtrid = UidGenerator.generateUid();

    assertEquals(0, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTING, gtrid, csvToSet("name1"));
    assertEquals(1, journal.collectDanglingRecords().size());

    journal.log(Status.STATUS_COMMITTED, gtrid, csvToSet("name1"));
    assertEquals(0, journal.collectDanglingRecords().size());
  }