+// TriggerTimesFileReader ttfr = new TriggerTimesFileReader();
+// List<Instant> triggerTimes = ttfr.readTriggerTimes(triggerTimesFile, false);
+//
+// System.out.println("ON signature file in use is " + onSignatureFile);
+// System.out.println("OFF signature file in use is " + offSignatureFile);
+//
+// List<List<List<PcapPacket>>> onSignature = PrintUtils.deserializeSignatureFromFile(onSignatureFile);
+// List<List<List<PcapPacket>>> offSignature = PrintUtils.deserializeSignatureFromFile(offSignatureFile);
+//
+// List<Instant> signatureTimestamps = new ArrayList<>();
+// // Load ON signature last packet's timestamp
+// // Get the last only
+// List<List<PcapPacket>> lastListOn = onSignature.get(onSignature.size()-1);
+// for (List<PcapPacket> list : lastListOn) {
+// // Get timestamp Instant from the last packet
+// int lastPacketIndex = list.size()-1;
+// signatureTimestamps.add(list.get(lastPacketIndex).getTimestamp());
+// }
+// // Load OFF signature last packet's timestamp
+// // Get the last only
+// List<List<PcapPacket>> lastListOff = offSignature.get(offSignature.size()-1);
+// for (List<PcapPacket> list : lastListOff) {
+// // Get timestamp Instant from the last packet
+// int lastPacketIndex = list.size()-1;
+// signatureTimestamps.add(list.get(lastPacketIndex).getTimestamp());
+// }
+// // Sort the timestamps
+// signatureTimestamps.sort((p1, p2) -> {
+// return p1.compareTo(p2);
+// });
+//
+// Iterator<Instant> iterTrig = triggerTimes.iterator();
+// Iterator<Instant> iterSign = signatureTimestamps.iterator();
+// System.out.println("Trigger to Last Packet:");
+// while (iterTrig.hasNext() && iterSign.hasNext()) {
+// Instant trigInst = (Instant) iterTrig.next();
+// Instant signInst = (Instant) iterSign.next();
+// Duration dur = Duration.between(trigInst, signInst);
+// long duration = dur.toMillis();
+// // Check duration --- should be below 15 seconds
+// if (duration >= 0 && duration <= 15000) {
+// System.out.println(dur.toMillis());
+// } else if (duration > 15000) {
+// while (duration > 15000) { // that means we have to move to the next trigger
+// trigInst = (Instant) iterTrig.next();
+// dur = Duration.between(trigInst, signInst);
+// duration = dur.toMillis();
+// }
+// System.out.println(dur.toMillis());
+// } else { // below 0 / negative --- that means we have to move to the next signature
+// while (duration < 0) { // that means we have to move to the next trigger
+// signInst = (Instant) iterSign.next();
+// dur = Duration.between(trigInst, signInst);
+// duration = dur.toMillis();
+// }
+// System.out.println(dur.toMillis());
+// }
+// }
+//
+//
+// // ==========================================================================
+// List<Instant> firstSignatureTimestamps = new ArrayList<>();
+// List<Instant> lastSignatureTimestamps = new ArrayList<>();
+// List<List<PcapPacket>> firstListOnSign = onSignature.get(0);
+// List<List<PcapPacket>> lastListOnSign = onSignature.get(onSignature.size()-1);
+// // Load ON signature first and last packet's timestamps
+// for (List<PcapPacket> list : firstListOnSign) {
+// // Get timestamp Instant from the last packet
+// firstSignatureTimestamps.add(list.get(0).getTimestamp());
+// }
+// for (List<PcapPacket> list : lastListOnSign) {
+// // Get timestamp Instant from the last packet
+// int lastPacketIndex = list.size()-1;
+// lastSignatureTimestamps.add(list.get(lastPacketIndex).getTimestamp());
+// }
+//
+// List<List<PcapPacket>> firstListOffSign = offSignature.get(0);
+// List<List<PcapPacket>> lastListOffSign = offSignature.get(offSignature.size()-1);
+// // Load OFF signature first and last packet's timestamps
+// for (List<PcapPacket> list : firstListOffSign) {
+// // Get timestamp Instant from the last packet
+// firstSignatureTimestamps.add(list.get(0).getTimestamp());
+// }
+// for (List<PcapPacket> list : lastListOffSign) {
+// // Get timestamp Instant from the last packet
+// int lastPacketIndex = list.size()-1;
+// lastSignatureTimestamps.add(list.get(lastPacketIndex).getTimestamp());
+// }
+// // Sort the timestamps
+// firstSignatureTimestamps.sort((p1, p2) -> {
+// return p1.compareTo(p2);
+// });
+// // Sort the timestamps
+// lastSignatureTimestamps.sort((p1, p2) -> {
+// return p1.compareTo(p2);
+// });
+//
+// Iterator<Instant> iterFirst = firstSignatureTimestamps.iterator();
+// Iterator<Instant> iterLast = lastSignatureTimestamps.iterator();
+// System.out.println("First to Last Packet:");
+// while (iterFirst.hasNext() && iterLast.hasNext()) {
+// Instant firstInst = (Instant) iterFirst.next();
+// Instant lastInst = (Instant) iterLast.next();
+// Duration dur = Duration.between(firstInst, lastInst);
+// long duration = dur.toMillis();
+// // Check duration --- should be below 15 seconds
+// if (duration >= 0 && duration <= 15000) {
+// System.out.println(dur.toMillis());
+// } else if (duration > 15000) {
+// while (duration > 15000) { // that means we have to move to the next trigger
+// firstInst = (Instant) iterFirst.next();
+// dur = Duration.between(firstInst, lastInst);
+// duration = dur.toMillis();
+// }
+// System.out.println(dur.toMillis());
+// } else { // below 0 / negative --- that means we have to move to the next signature
+// while (duration < 0) { // that means we have to move to the next trigger
+// lastInst = (Instant) iterLast.next();
+// dur = Duration.between(firstInst, lastInst);
+// duration = dur.toMillis();
+// }
+// System.out.println(dur.toMillis());
+// }
+// if (duration > 8000) {
+// break;
+// }
+// }