MessageFormatParser { public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); }  Map<String, TypeDefinition> parse(InputStream source);  }
@Test void parseNull() { assertThrows(NullPointerException.class, () -> SUT.parse(null)); }
@Test void parseSomething() { Map<String, TypeDefinition> parse = SUT.parse(getClass().getResourceAsStream("/mspec.example")); System.out.println(parse); }