DanaRSMessageHashTable { public static DanaRS_Packet findMessage(Integer command) { if (messages.containsKey(command)) { return messages.get(command); } else { return new DanaRS_Packet(); } }  static void put(DanaRS_Packet message); static DanaRS_Packet findMessage(Integer command); static HashMap<Integer, DanaRS_Packet> messages; }
@Test public void runTest() { AAPSMocker.mockMainApp(); AAPSMocker.mockApplicationContext(); AAPSMocker.mockSP(); AAPSMocker.mockL(); DanaRS_Packet forTesting = new DanaRS_Packet_APS_Set_Event_History(); DanaRS_Packet testPacket = DanaRSMessageHashTable.findMessage(forTesting.getCommand()); assertEquals(BleCommandUtil.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY, testPacket.getOpCode()); }