AllophoneSet { public static AllophoneSet getAllophoneSet(String filename) throws MaryConfigurationException { InputStream fis = null; try { fis = new FileInputStream(filename); } catch (IOException e) { throw new MaryConfigurationException("Problem reading allophone file "+filename, e); } assert fis != null; return getAllophoneSet(fis, filename); } private  AllophoneSet(InputStream inputStream); static AllophoneSet getAllophoneSet(String filename); static boolean hasAllophoneSet(String identifier); static AllophoneSet getAllophoneSetById(String identifier); static AllophoneSet getAllophoneSet(InputStream inStream, String identifier); Locale getLocale(); Allophone getAllophone(String ph); Allophone getSilence(); String getIgnoreChars(); String getPhoneFeature(String ph, String featureName); Set<String> getPhoneFeatures(); String[] getPossibleFeatureValues(String featureName); Set<String> getAllophoneNames(); Allophone[] splitIntoAllophones(String allophoneString); String splitAllophoneString(String allophoneString); boolean checkAllophoneSyntax(String allophoneString);  }
@Test public void testLoadOnceReuse() throws MaryConfigurationException { InputStream alloStream = AllophoneSetTest.class.getResourceAsStream("allophones.de.xml"); AllophoneSet allo1a = AllophoneSet.getAllophoneSet(alloStream, "test1"); InputStream alloStream1b = AllophoneSetTest.class.getResourceAsStream("allophones.de.xml"); AllophoneSet allo1b = AllophoneSet.getAllophoneSet(alloStream1b, "test1"); assertEquals(allo1a, allo1b); }