class App {
  /**
   * Constant parameter name to use mongoDB.
   */
  private static final String USE_MONGO_DB = "--mongo";
  /**
   * Application manager.
   */
  private final AppManager appManager;

  /**
   * Constructor of current App.
   *
   * @param isMongo boolean
   */
  public App(final boolean isMongo) {
    DbManager dbManager = DbManagerFactory.initDb(isMongo);
    appManager = new AppManager(dbManager);
    appManager.initDb();
  }

  /**
   * Program entry point.
   *
   * @param args command line args
   */
  public static void main(final String[] args) {<FILL_FUNCTION_BODY>}

  /**
   * Check the input parameters. if
   *
   * @param args input params
   * @return true if there is "--mongo" parameter in arguments
   */
  private static boolean isDbMongo(final String[] args) {
    for (String arg : args) {
      if (arg.equals(USE_MONGO_DB)) {
        return true;
      }
    }
    return false;
  }

  /**
   * Read-through and write-through.
   */
  public void useReadAndWriteThroughStrategy() {
    LOGGER.info("# CachingPolicy.THROUGH");
    appManager.initCachingPolicy(CachingPolicy.THROUGH);

    var userAccount1 = new UserAccount("001", "John", "He is a boy.");

    appManager.save(userAccount1);
    LOGGER.info(appManager.printCacheContent());
    appManager.find("001");
    appManager.find("001");
  }

  /**
   * Read-through and write-around.
   */
  public void useReadThroughAndWriteAroundStrategy() {
    LOGGER.info("# CachingPolicy.AROUND");
    appManager.initCachingPolicy(CachingPolicy.AROUND);

    var userAccount2 = new UserAccount("002", "Jane", "She is a girl.");

    appManager.save(userAccount2);
    LOGGER.info(appManager.printCacheContent());
    appManager.find("002");
    LOGGER.info(appManager.printCacheContent());
    userAccount2 = appManager.find("002");
    userAccount2.setUserName("Jane G.");
    appManager.save(userAccount2);
    LOGGER.info(appManager.printCacheContent());
    appManager.find("002");
    LOGGER.info(appManager.printCacheContent());
    appManager.find("002");
  }

  /**
   * Read-through and write-behind.
   */
  public void useReadThroughAndWriteBehindStrategy() {
    LOGGER.info("# CachingPolicy.BEHIND");
    appManager.initCachingPolicy(CachingPolicy.BEHIND);

    var userAccount3 = new UserAccount("003",
            "Adam",
            "He likes food.");
    var userAccount4 = new UserAccount("004",
            "Rita",
            "She hates cats.");
    var userAccount5 = new UserAccount("005",
            "Isaac",
            "He is allergic to mustard.");

    appManager.save(userAccount3);
    appManager.save(userAccount4);
    appManager.save(userAccount5);
    LOGGER.info(appManager.printCacheContent());
    appManager.find("003");
    LOGGER.info(appManager.printCacheContent());
    UserAccount userAccount6 = new UserAccount("006",
            "Yasha",
            "She is an only child.");
    appManager.save(userAccount6);
    LOGGER.info(appManager.printCacheContent());
    appManager.find("004");
    LOGGER.info(appManager.printCacheContent());
  }

  /**
   * Cache-Aside.
   */
  public void useCacheAsideStategy() {
    LOGGER.info("# CachingPolicy.ASIDE");
    appManager.initCachingPolicy(CachingPolicy.ASIDE);
    LOGGER.info(appManager.printCacheContent());

    var userAccount3 = new UserAccount("003",
            "Adam",
            "He likes food.");
    var userAccount4 = new UserAccount("004",
            "Rita",
            "She hates cats.");
    var userAccount5 = new UserAccount("005",
            "Isaac",
            "He is allergic to mustard.");
    appManager.save(userAccount3);
    appManager.save(userAccount4);
    appManager.save(userAccount5);

    LOGGER.info(appManager.printCacheContent());
    appManager.find("003");
    LOGGER.info(appManager.printCacheContent());
    appManager.find("004");
    LOGGER.info(appManager.printCacheContent());
  }
}

    // VirtualDB (instead of MongoDB) was used in running the JUnit tests
    // and the App class to avoid Maven compilation errors. Set flag to
    // true to run the tests with MongoDB (provided that MongoDB is
    // installed and socket connection is open).
    boolean isDbMongo = isDbMongo(args);
    if (isDbMongo) {
      LOGGER.info("Using the Mongo database engine to run the application.");
    } else {
      LOGGER.info("Using the 'in Memory' database to run the application.");
    }
    App app = new App(isDbMongo);
    app.useReadAndWriteThroughStrategy();
    String splitLine = "==============================================";
    LOGGER.info(splitLine);
    app.useReadThroughAndWriteAroundStrategy();
    LOGGER.info(splitLine);
    app.useReadThroughAndWriteBehindStrategy();
    LOGGER.info(splitLine);
    app.useCacheAsideStategy();
    LOGGER.info(splitLine);
  
<no_super_class>