### Question:
LmVocabulary { public static LmVocabulary loadFromDataInputStream(DataInputStream dis) throws IOException { return new LmVocabulary(dis); } LmVocabulary(String... vocabulary);  LmVocabulary(List<String> vocabulary); private  LmVocabulary(RandomAccessFile raf); private  LmVocabulary(DataInputStream dis); static LmVocabulary loadFromBinary(File binaryVocabularyFile); static LmVocabulary loadFromBinary(Path binaryVocabularyFilePath); static LmVocabulary loadFromRandomAccessFile(RandomAccessFile raf); static LmVocabulary loadFromDataInputStream(DataInputStream dis); static LmVocabulary loadFromUtf8File(File utfVocabularyFile); static Builder builder(); static LmVocabulary intersect(LmVocabulary v1, LmVocabulary v2); void saveBinary(File file); void saveBinary(DataOutputStream dos); int size(); boolean containsUnknown(int... gramIds); boolean containsSuffix(); boolean containsPrefix(); String getWord(int index); int indexOf(String word); int getSentenceStartIndex(); int getSentenceEndIndex(); int getUnknownWordIndex(); String getUnknownWord(); String getSentenceStart(); String getSentenceEnd(); Iterable<Integer> alphabeticallySortedWordsIds(Locale locale); Iterable<Integer> alphabeticallySortedWordsIds(); Iterable<String> words(); Iterable<String> wordsSorted(); Iterable<String> wordsSorted(Locale locale); String getWordsString(int... indexes); boolean containsAll(int... indexes); boolean contains(int index); boolean containsAll(String... words); boolean contains(String word); long encodeTrigram(int g0, int g1, int g2); long encodeTrigram(int... triGram); int[] toIndexes(String... words); int[] toIndexes(String[] history, String word); int[] toIndexes(int[] history, String word); String[] toWords(int... indexes); static final String DEFAULT_SENTENCE_BEGIN_MARKER; static final String DEFAULT_SENTENCE_END_MARKER; static final String DEFAULT_UNKNOWN_WORD; }### Answer:
@Test public void streamGenerationTest() throws IOException { File tmp = getBinaryVocFile(); try (DataInputStream dis = new DataInputStream(new FileInputStream(tmp))) { LmVocabulary vocabulary = LmVocabulary.loadFromDataInputStream(dis); simpleCheck(vocabulary); } }