@Test(expected = AssertionError.class) public void testFromJsonWithExtraProperties() { Foo foo = JsonHelper.fromJson("{'foo':1, 'bar':2, 'baz':'Hello World'}", Foo.class); assertEquals(1, foo.bar); assertEquals("Hello World", foo.baz); }
static <T> T fromJson(String string, Class<T> type) { try { return JSON.readValue(string, type); } catch (IOException e) { throw new AssertionError(e); } }
JsonHelper { static <T> T fromJson(String string, Class<T> type) { try { return JSON.readValue(string, type); } catch (IOException e) { throw new AssertionError(e); } } }
JsonHelper { static <T> T fromJson(String string, Class<T> type) { try { return JSON.readValue(string, type); } catch (IOException e) { throw new AssertionError(e); } }  }
JsonHelper { static <T> T fromJson(String string, Class<T> type) { try { return JSON.readValue(string, type); } catch (IOException e) { throw new AssertionError(e); } }   }
JsonHelper { static <T> T fromJson(String string, Class<T> type) { try { return JSON.readValue(string, type); } catch (IOException e) { throw new AssertionError(e); } }    }