protected static String loadResource(String res) {
        try {
            ClassLoader loader = BodyTest.class.getClassLoader();
            URL url = loader.getResource(res);
            InputStream stream = url.openStream();
            ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
            int read;
            byte[] buffer = new byte[512];
            do {
                read = stream.read(buffer);
                if (read > 0) {
                    byteOut.write(buffer, 0, read);
                }
            } while(read >= 0);
            return new String(byteOut.toByteArray());
        } catch (IOException iox) {
            throw(new IllegalStateException(
                    "Could not load resource: " + res));
        }
    }