### Question:
TreeUtil { public static <T> T load(final URL url, Class<T> clazz) throws DecodeException { return load(url, null, clazz); } private  TreeUtil(); static String toJson(Object obj); static JsonNode toJsonNode(Object obj); static String toYaml(Object obj); static T load(final URL url, Class<T> clazz); static T load(final URL url, final List<AuthOption> authOptions, Class<T> clazz); static JsonNode load(final URL url); static JsonNode load(final URL url, final List<AuthOption> authOptions); static final String ENCODE_ERR_MSG; static final ObjectMapper json; static final ObjectMapper yaml; }### Answer:
@Test public void simpleLoad() throws DecodeException { assertNotNull(TreeUtil.load(getClass().getResource("/parsing/discriminator.yaml"))); assertNotNull(TreeUtil.load(getClass().getResource("/parsing/discriminator.json"))); }
@Test public void remoteLoad() throws DecodeException, MalformedURLException { AuthOption option1 = new AuthOption(AuthOption.Type.QUERY, "a", "value"); AuthOption option2 = new AuthOption(AuthOption.Type.HEADER, "another", "value"); assertNotNull(TreeUtil.load( new URL("http: Arrays.asList(option1, option2))); }
@Test(expected = DecodeException.class) public void simpleLoadInvalid() throws DecodeException, MalformedURLException { TreeUtil.load(new URL("file: }
@Test public void classLoad() throws DecodeException { assertNotNull(TreeUtil.load(getClass().getResource("/parsing/discriminator.yaml"), Object.class)); assertNotNull(TreeUtil.load(getClass().getResource("/parsing/discriminator.json"), Object.class)); }
@Test(expected = DecodeException.class) public void classLoadInvalid() throws DecodeException, MalformedURLException { TreeUtil.load(new URL("file: }
@Test public void emptyDocumentValid() throws DecodeException { assertNull(TreeUtil.load(getClass().getResource("/parsing/empty.yaml"))); }