LanguageRegistry { @Deprecated public static LanguageVersion findLanguageVersionByTerseName(String terseNameAndVersion) { String version; String terseName; if (terseNameAndVersion.contains(" ")) { version = StringUtils.trimToNull(terseNameAndVersion.substring(terseNameAndVersion.lastIndexOf(' ') + 1)); terseName = terseNameAndVersion.substring(0, terseNameAndVersion.lastIndexOf(' ')); } else { version = null; terseName = terseNameAndVersion; } Language language = findLanguageByTerseName(terseName); if (language != null) { if (version == null) { return language.getDefaultVersion(); } else { return language.getVersion(version); } } return null; } private  LanguageRegistry(); @Deprecated static LanguageRegistry getInstance(); static Collection<Language> getLanguages(); static Language getLanguage(String languageName); static Language getDefaultLanguage(); static Language findLanguageByTerseName(String terseName); @Deprecated static LanguageVersion findLanguageVersionByTerseName(String terseNameAndVersion); static List<Language> findByExtension(String extension); @Deprecated static List<LanguageVersion> findAllVersions(); @Deprecated static List<Language> findWithRuleSupport(); @Deprecated static String commaSeparatedTerseNamesForLanguage(List<Language> languages); @Deprecated static String commaSeparatedTerseNamesForLanguageVersion(List<LanguageVersion> languageVersions);  }
@Test public void getLanguageVersionByNameAliasTest() { LanguageVersion dummy17 = LanguageRegistry.findLanguageVersionByTerseName("dummy 1.7"); Assert.assertNotNull(dummy17); Assert.assertEquals("1.7", dummy17.getVersion()); LanguageVersion dummy7 = LanguageRegistry.findLanguageVersionByTerseName("dummy 7"); Assert.assertNotNull(dummy7); Assert.assertEquals("1.7", dummy17.getVersion()); Assert.assertSame(dummy17, dummy7); }