### Question:
ResourceUtils { public String getResourceAsString(String url) { try { return readFullyString(getResourceFromUrl(url)); } catch (Exception e) { log.debug("ResourceUtils got error reading "+url+(context==null?"":" "+context)+" (rethrowing): "+e); throw Throwables.propagate(e); } } ResourceUtils(ClassLoader loader, Object contextObject, String contextMessage);  ResourceUtils(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage);  ResourceUtils(Object contextObject, String contextMessage);  ResourceUtils(Object contextObject); static final ResourceUtils create(ClassLoader loader, Object contextObject, String contextMessage); static final ResourceUtils create(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject); static final ResourceUtils create(); static void addClassLoaderProvider(Function<Object,BrooklynClassLoadingContext> provider); Iterable<URL> getResources(String name); InputStream getResourceFromUrl(String url); static URL tidy(URL url); static String tidyFileUrl(String url); @Deprecated static String mergeFilePaths(String... items); @Deprecated static String tidyFilePath(String path); @Deprecated static String getProtocol(String url); String getResourceAsString(String url); String checkUrlExists(String url); String checkUrlExists(String url, String message); boolean doesUrlExist(String url); Optional<String> firstAvailableUrl(String ...urls); String getClassLoaderDir(); String getClassLoaderDir(String resourceInThatDir); static URL getContainerUrl(URL url, String resourceInThatDir); @Deprecated static String readFullyString(InputStream is); @Deprecated static byte[] readFullyBytes(InputStream is); @Deprecated static void copy(InputStream input, OutputStream output); @Deprecated static File mkdirs(File dir); @Deprecated static File writeToTempFile(InputStream is, String prefix, String suffix); @Deprecated static File writeToTempFile(InputStream is, File tempDir, String prefix, String suffix); @Deprecated static File writeToTempFile(Properties props, String prefix, String suffix); @Deprecated static File writeToTempFile(Properties props, File tempDir, String prefix, String suffix); @Deprecated static Thread addShutdownHook(final Runnable task); @Deprecated static boolean removeShutdownHook(Thread hook); @Deprecated static String mergePaths(String ...items);  }### Answer:
@Test public void testDataUrl() throws Exception { assertEquals(utils.getResourceAsString("data:,hello"), "hello"); assertEquals(utils.getResourceAsString("data:,hello%20world"), "hello world"); assertEquals(utils.getResourceAsString("data:hello"), "hello"); assertEquals(utils.getResourceAsString("data: assertEquals(utils.getResourceAsString("data:hello world"), "hello world"); assertEquals(utils.getResourceAsString(Urls.asDataUrlBase64("hello world")), "hello world"); String longString = Identifiers.makeRandomId(256); for (int a=32; a<128; a++) longString += (char)a; assertEquals(utils.getResourceAsString(Urls.asDataUrlBase64(longString)), longString); }