private static URI resourceToURI(final String name) {
        final URL url = TestResources.class.getResource(name);
        if (url == null) {
            throw new IllegalArgumentException("Resource does not exist: " + name);
        }
        try {
            return url.toURI();
        } catch (final URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }
Gets a {@link Path} for a {@linkplain Class#getResource(String) resource path}.
src/test/java/org/apache/commons/imaging/test/TestResources.java