protected JsonNode jsonPortStatsDelta(DeviceService deviceService, Iterable<Device> devices) {
        ObjectMapper mapper = new ObjectMapper();
        ArrayNode result = mapper.createArrayNode();

        for (Device device : devices) {
            result.add(jsonPortStatsDelta(device.id(), mapper, deviceService.getPortDeltaStatistics(device.id())));
        }

        return result;
    }
@Test
    public void testJsonPortStatsDelta() {

        JsonNode node = devicePortStatsCommand.jsonPortStatsDelta(deviceService, devices).get(0);

        float duration = ((float) portStatistics.durationSec()) +
                (((float) portStatistics.durationNano()) / TimeUnit.SECONDS.toNanos(1));
        float rateRx = portStatistics.bytesReceived() * 8 / duration;
        float rateTx = portStatistics.bytesSent() * 8 / duration;

        assertEquals(node.findValue("deviceId").asText(), id1.toString());
        assertEquals(node.findValue("port").asText(), portStatistics.portNumber().toString());
        assertEquals(node.findValue("pktRx").asLong(), portStatistics.packetsReceived());
        assertEquals(node.findValue("pktTx").asLong(), portStatistics.packetsSent());
        assertEquals(node.findValue("bytesRx").asLong(), portStatistics.bytesReceived());
        assertEquals(node.findValue("bytesTx").asLong(), portStatistics.bytesSent());
        assertEquals(node.findValue("rateRx").asText(), String.format("%.1f", rateRx));
        assertEquals(node.findValue("rateTx").asText(), String.format("%.1f", rateTx));
        assertEquals(node.findValue("pktRxDrp").asLong(), portStatistics.packetsRxDropped());
        assertEquals(node.findValue("pktTxDrp").asLong(), portStatistics.packetsTxDropped());
        assertEquals(node.findValue("interval").asText(), String.format("%.3f", duration));

    }