### Question:
TermAnalyzers { public Analyzer findAnalyzer(String locale, boolean useStopWords) { Map<String, Analyzer> analyzers = useStopWords ? stopwordAnalyzers : nonStopwordAnalyzers; Analyzer analyzer = null; if (locale != null && !locale.isEmpty()) { String code = locale; analyzer = analyzers.get(code); while (analyzer == null) { int ix = code.indexOf('_'); if (ix == -1) { break; } code = code.substring(0, ix); analyzer = analyzers.get(code); } } if (analyzer == null) { analyzer = useStopWords ? STOPWORD_STANDARD_ANALYZER : NON_STOPWORD_STANDARD_ANALYZER; } return analyzer; }  Analyzer findAnalyzer(String locale, boolean useStopWords); static void main(String[] args);  }### Answer:
@Test public void testFindAnalyzer() throws Exception { TermAnalyzers termAnalyzers = new TermAnalyzers(); for (String locale : Lists.newArrayList("en", "zh_cn", "foo_bar_bazz")) { Analyzer analyzer = termAnalyzers.findAnalyzer(locale, false); assertEquals("6.2.1", analyzer.getVersion().toString()); } }