### Question:
RailsRoutesParser implements EventBasedTokenizer { public static Map parse(@Nonnull File file) { if (!file.exists()) { LOG.error("File not found. Exiting. " + file.getName()); return null; } RailsRoutesParser parser = new RailsRoutesParser(); EventBasedTokenizerRunner.runRails(file, parser); return parser.mappings; }  static Map parse(@Nonnull File file); @Override boolean shouldContinue(); @Override void processToken(int type, int lineNumber, String stringValue);  }### Answer:
@Test public void testRailsGoatRoutesParser() { File f = ResourceManager.getRailsFile("railsgoat_routes.rb"); assert(f.exists()); Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f); compareRoutes(RAILSGOAT_ROUTES, mappings); }
@Test public void testDiscourseRoutesParser() { File f = ResourceManager.getRailsFile("discource_routes.rb"); assert(f.exists()); Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f); compareRoutes(DISCOURSE_ROUTES, mappings); }
@Test public void testGitlabRoutesParser() throws Exception { File f = ResourceManager.getRailsFile("gitlab_routes.rb"); assert(f.exists()); Map<String, RailsRoute> mappings = RailsRoutesParser.parse(f); compareRoutes(GITLAB_ROUTES, mappings); }