static boolean encodeTest(String input, String result) {
        try {
            byte[] output = hexStringToBytes(result);
            Cbor cbor = new Cbor(1000);
            //           JSONArray js;
            //          js = new JSONArray("[" + input + "]");
            try {
                Long l = Long.parseLong(input);
                cbor.add(l);
            } catch (Exception e) {
                try {
                    Float f = Float.parseFloat(input);
                    cbor.add(f);
                } catch (Exception e2) {
                    try {
                        Double d = Double.parseDouble(input);
                        cbor.add(d);
                    } catch (Exception e3) {
                        try {
                            Boolean b = Boolean.parseBoolean(input);
                            cbor.add(b);
                        } catch (Exception e4) {
                            e4.printStackTrace();
                        }
                    }
                }
            }
            byte[] gen = cbor.bytes();
            //compare 
            if (!bytesEqual(gen, output)) {
                System.out.println(" expected : " + bytesToHexString(output) + " generated : " + bytesToHexString(gen));
            } else {
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }