code: public static synchronized Database getInstance(@NonNull Application app, boolean resetDBHelperInstance, @NonNull Logger log) {
  
          if (dbHelper == null) {
              dbHelper = DatabaseHelper.getInstance(app.getApplicationContext());
          } else if (resetDBHelperInstance) {
              //For testing purposes we need separate instance of DatabaseHelper for every test.
              dbHelper = new DatabaseHelper(app.getApplicationContext());
          }
  
          return new Database(log);
      }
docs: Creates database controller and new database instance if wasn't created yet or parameter reset was set to true.
  
  @param app                   Application instance.
  @param resetDBHelperInstance True if underlying db helper should be recreated. This should be set to true only for tests.
  @param log                   Logger instance to use Foundation logging mechanism.
  @return DB controller instance.