### Question:
ZWaveCommandClass implements Serializable { public void add(ZWaveCommand command) { command.commandClass = number; commands.add(command); commandsByName.put(scrub(command.commandName), command); commandsByByte.put(command.commandNumber, command); } @JsonCreator  ZWaveCommandClass();  ZWaveCommandClass(String name, byte number); void addZWaveCommand(ZWaveCommand command); void add(ZWaveCommand command); ZWaveCommand get(String commandName); ZWaveCommand get(byte commandNumber); boolean set(String commandName, String varname, byte value); boolean setSend(String commandName, String varname, byte value); boolean setRecv(String commandName, String varname, byte value); byte get(String commandName, String varname); byte getRecv(String commandName, String varname); byte getSend(String commandName, String varname); static String scrub(String str); @Override String toString(); @JsonProperty("name")
   public String name; @JsonProperty("id")
   public byte number; @JsonProperty("version")
   public byte version; @JsonIgnore
   final public LinkedHashMap<String, ZWaveCommand> commandsByName; @JsonIgnore
   final public LinkedHashMap<Byte, ZWaveCommand> commandsByByte; }### Answer:
@Test public void testJacksonCreateSaveAndLoad() throws Exception { File filename = File.createTempFile("TestZWaveCommandClass", ".json"); filename.deleteOnExit(); ZWaveCommandClass switchCommandClass = new ZWaveCommandClass("Switch Binary",(byte) 0x25); ZWaveCommand setCommand = new ZWaveCommand("set",(byte) 0x01); setCommand.addSendVariable("value"); ZWaveCommand getCommand = new ZWaveCommand("get",(byte) 0x02); ZWaveCommand reportCommand = new ZWaveCommand("report",(byte) 0x03); reportCommand.addReceiveVariable("value"); switchCommandClass.add(setCommand); switchCommandClass.add(getCommand); switchCommandClass.add(reportCommand); ObjectMapper mapper = new ObjectMapper(); mapper.writerWithDefaultPrettyPrinter().writeValue(new FileWriter(filename), switchCommandClass); ObjectMapper mapper2 = new ObjectMapper(); @SuppressWarnings("unused") ZWaveCommandClass setCommand2 = mapper2.readValue(FileUtils.readFileToByteArray(filename), ZWaveCommandClass.class ); }