public static void copyObject(Inspector from, Cursor to) {
        if (from.type() != Type.OBJECT) {
            throw new IllegalArgumentException("Cannot copy object: " + from);
        }
        from.traverse((ObjectTraverser) (name, inspector) -> setObjectEntry(inspector, name, to));

    }
@Test
    public void test_copying_slime_types_into_cursor() {
        Slime slime = new Slime();
        Cursor root = slime.setObject();
        root.setString("foo", "foobie");
        Cursor subobj = root.setObject("bar");

        Slime slime2 = new Slime();
        Cursor root2 = slime2.setObject();
        root2.setString("a", "a");
        root2.setLong("b", 2);
        root2.setBool("c", true);
        root2.setDouble("d", 3.14);
        root2.setData("e", new byte[]{0x64});
        root2.setNix("f");

        SlimeUtils.copyObject(slime2.get(), subobj);

        assertEquals("{\"foo\":\"foobie\",\"bar\":{\"a\":\"a\",\"b\":2,\"c\":true,\"d\":3.14,\"e\":\"0x64\",\"f\":null}}",
                     root.toString());
    }