### Question:
JsonRequestTranslator { public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } } private  JsonRequestTranslator(); static Request load(String jsonString); static Request load(File fileRequest); static Request load(InputStream is); static String toString(Request request, boolean prettyPrint);  }### Answer:
@Test public void testMulti() throws Exception { Request request = JsonRequestTranslator.load(new File("src/test/resources/Request-Multi.json")); validateMulti(request); }
@Test public void testExceptions() { assertThatExceptionOfType(JSONStructureException.class).isThrownBy(() -> { JsonRequestTranslator.load(new File(folder.getRoot().getAbsolutePath() + "/idontexist.json")); }); assertThatExceptionOfType(JSONStructureException.class).isThrownBy(() -> { JsonRequestTranslator.load("iamnot a json string at all"); }); assertThatExceptionOfType(JSONStructureException.class).isThrownBy(() -> { try (ByteArrayInputStream is = new ByteArrayInputStream("fjskfjdskalfjdkslajdf".getBytes())) { JsonRequestTranslator.load(is); } }); }