private static String asHexString(GlobalId gid) {
        StringBuilder sb = new StringBuilder();
        byte[] rawGid = gid.getRawId();
        for (byte b : rawGid) {
            String hex = Integer.toHexString(0xFF & b);
            if (hex.length() == 1)
                sb.append('0');
            sb.append(hex);
        }
        return sb.toString();
    }
Tests docsum class functionality

@author bratseth
container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java