public JsonNode resolve(URI uri) {

        if (CLASSPATH_SCHEMES.contains(uri.getScheme())) {
            return resolveFromClasspath(uri);
        }

        try {
            return objectMapper.readTree(uri.toURL());
        } catch (JsonProcessingException e) {
            throw new IllegalArgumentException("Error parsing document: " + uri, e);
        } catch (IOException e) {
            throw new IllegalArgumentException("Unrecognised URI, can't resolve this: " + uri, e);
        }

    }
@Test(expected=IllegalArgumentException.class)
    public void wrongProtocolCausesIllegalArgumentException() {

        URI uriWithUnrecognisedProtocol = URI.create("foobar://schema/address.json"); 
        resolver.resolve(uriWithUnrecognisedProtocol);
    }