### Question:
ATCommandQueuePacket extends XBeeAPIPacket { public String getParameterAsString() { if (parameter == null) return null; return new String(parameter); } ATCommandQueuePacket(int frameID, String command, String parameter);  ATCommandQueuePacket(int frameID, String command, byte[] parameter); static ATCommandQueuePacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); String getCommand(); void setParameter(String parameter); void setParameter(byte[] parameter); byte[] getParameter(); String getParameterAsString(); @Override boolean isBroadcast(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testGetParameterAsString() { int frameID = 0x10; String command = "NI"; String parameterToSet = "newNIValue"; ATCommandQueuePacket packet = new ATCommandQueuePacket(frameID, command, parameterToSet); String value = packet.getParameterAsString(); assertThat("Returned parameter must be '" + parameterToSet + "'", value, is(equalTo(parameterToSet))); }
@Test public final void testGetParameterAsStringNullValue() { int frameID = 0x10; String command = "NI"; ATCommandQueuePacket packet = new ATCommandQueuePacket(frameID, command, (String)null); String value = packet.getParameterAsString(); assertThat("Returned parameter must be 'null'", value, is(equalTo(null))); }