### Question:
CSSURLHelper { @Nonnull @Nonempty public static String getAsCSSURL (@Nonnull final ISimpleURL aURL, final boolean bQuoteURL) { ValueEnforcer.notNull (aURL, "URL"); return getAsCSSURL (aURL.getAsStringWithEncodedParameters (), bQuoteURL); } private  CSSURLHelper(); static boolean isURLValue(@Nullable final String sValue); @Nullable static String getURLValue(@Nullable final String sValue); @Nonnull @Nonempty static String getAsCSSURL(@Nonnull final ISimpleURL aURL, final boolean bQuoteURL); static boolean isValidCSSURLChar(final char c); static boolean isCSSURLRequiringQuotes(@Nonnull final String sURL); @Nonnull @Nonempty static String getEscapedCSSURL(@Nonnull final String sURL, final char cQuoteChar); @Nonnull @Nonempty static String getAsCSSURL(@Nonnull final String sURL, final boolean bForceQuoteURL); static final boolean DEFAULT_QUOTE_URLS; }### Answer:
@Test public void testGetAsCSSURL () { for (final String sURL : new String [] { "a.gif", "\"a.gif\"", "b\\a.gif", "\\b\\a\\c.gif", "'a.gif'", "'a\".gif'", "\"a'.gif\"", "a().gif", "a\\(\\).gif" }) { final String sEscaped = CSSURLHelper.getAsCSSURL (sURL, false); assertEquals (sURL, CSSParseHelper.trimUrl (sEscaped)); } assertEquals ("url(a.gif)", CSSURLHelper.getAsCSSURL ("a.gif", false)); assertEquals ("url('a.gif')", CSSURLHelper.getAsCSSURL ("a.gif", true)); assertEquals ("url('\"a.gif\"')", CSSURLHelper.getAsCSSURL ("\"a.gif\"", true)); assertEquals ("url('\"a.gif\"')", CSSURLHelper.getAsCSSURL ("\"a.gif\"", false)); assertEquals ("url('b\\\\a.gif')", CSSURLHelper.getAsCSSURL ("b\\a.gif", false)); assertEquals ("url(\"'a.gif'\")", CSSURLHelper.getAsCSSURL ("'a.gif'", true)); assertEquals ("url(\"'a.gif'\")", CSSURLHelper.getAsCSSURL ("'a.gif'", false)); assertEquals ("url('\\'a\".gif\\'')", CSSURLHelper.getAsCSSURL ("'a\".gif'", true)); assertEquals ("url('\\'a\".gif\\'')", CSSURLHelper.getAsCSSURL ("'a\".gif'", false)); assertEquals ("url('\"a\\'.gif\"')", CSSURLHelper.getAsCSSURL ("\"a'.gif\"", true)); assertEquals ("url('\"a\\'.gif\"')", CSSURLHelper.getAsCSSURL ("\"a'.gif\"", false)); assertEquals ("url('a().gif')", CSSURLHelper.getAsCSSURL ("a().gif", false)); final SimpleURL aURL = new SimpleURL ("a.gif", new StringMap ("x", "y")); assertEquals ("url(a.gif?x=y)", CSSURLHelper.getAsCSSURL (aURL, false)); assertEquals ("url('a.gif?x=y')", CSSURLHelper.getAsCSSURL (aURL, true)); assertEquals ("url()", CSSURLHelper.getAsCSSURL (new SimpleURL (), false)); assertEquals ("url('')", CSSURLHelper.getAsCSSURL (new SimpleURL (), true)); assertEquals (aURL, new SimpleURL (CSSURLHelper.getURLValue (CSSURLHelper.getAsCSSURL (aURL, true)))); assertEquals ("url()", CSSURLHelper.getAsCSSURL ("", false)); assertEquals ("url('')", CSSURLHelper.getAsCSSURL ("", true)); }