@After
  public void dropDatabase() {
    Set<String> names = dbManager.getDB().getCollectionNames();
    for (String each : names) {
      if (!each.startsWith("system")) {
        dbManager.getDB().getCollection(each).drop();
      }
    }

    // dbManager.getDB().dropDatabase();
  }
 public static void initDbManager() {
   // to be able to do lazy loading of associations inside test class
   DbManager dbManager = new DbManager();
   dbManager.setDbname("Library-test");
   DbManager.setThreadInstance(dbManager);
 }
 private int countRowsInDBCollection(String name) {
   return (int) dbManager.getDBCollection(name).getCount();
 }
 @Before
 public void initDbManagerThreadInstance() throws Exception {
   // to be able to do lazy loading of associations inside test class
   DbManager.setThreadInstance(dbManager);
 }