public static String uncompress(byte[] compressedURL) {
        StringBuffer url = new StringBuffer();
        switch (compressedURL[0] & 0x0f) {
            case EDDYSTONE_URL_PROTOCOL_HTTP_WWW:
                url.append(URL_PROTOCOL_HTTP_WWW_DOT);
                break;
            case EDDYSTONE_URL_PROTOCOL_HTTPS_WWW:
                url.append(URL_PROTOCOL_HTTPS_WWW_DOT);
                break;
            case EDDYSTONE_URL_PROTOCOL_HTTP:
                url.append(URL_PROTOCOL_HTTP_COLON_SLASH_SLASH);
                break;
            case EDDYSTONE_URL_PROTOCOL_HTTPS:
                url.append(URL_PROTOCOL_HTTPS_COLON_SLASH_SLASH);
                break;
            default:
                break;
        }
        byte lastByte = -1;
        for (int i = 1; i < compressedURL.length; i++) {
            byte b = compressedURL[i];
            if (lastByte == 0 && b == 0 ) {
                break;
            }
            lastByte = b;
            String tld = topLevelDomainForByte(b);
            if (tld != null) {
                url.append(tld);
            }
            else {
                url.append((char) b);
            }
        }

        return url.toString();
    }
@Test
    public void testUncompressWithSubdomains() throws MalformedURLException {
        String testURL = "http://www.forums.google.com";
        byte[] testBytes = {0x00, 'f', 'o', 'r', 'u', 'm', 's', '.', 'g', 'o', 'o', 'g', 'l', 'e', 0x07};
        assertEquals(testURL, UrlBeaconUrlCompressor.uncompress(testBytes));
    }