JSON implements Serializable { public static JSON parse(InputStream in) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, UTF_8))) { String json = reader.lines().map(String::trim).collect(joining()); return parse(json); } } private  JSON(Map<String, Object> data); private  JSON(String path, Map<String, Object> data); static JSON parse(InputStream in); static JSON parse(String json); static JSON empty(); Set<String> keySet(); boolean contains(String key); Value get(String key); @Override String toString(); Map<String,Object> toMap();  }
@Test(expected = AcmeProtocolException.class) public void testParsersBadJSON() throws IOException { JSON.parse("This is no JSON."); }