code: private static int getIndexFromFilename(String fileName) {
          // remove the beginning of the file name
          String resStr = fileName.replace(
                  latestMOTDSerializedFileName.substring(0, latestMOTDSerializedFileName.indexOf("{index}")), "");
  
          // remove the end of the file name
          resStr = resStr.replace(
                  latestMOTDSerializedFileName.substring(latestMOTDSerializedFileName.indexOf("{index}") + 7), "");
  
          return Integer.parseInt(resStr);
      }
docs: Returns the index used in the given file name of a serialized
  {@code MOTD}
  
  @param fileName The file name to be analyzed
  @return The index used in the given file name of a serialized
  {@code MOTD}