### Question:
PcapGetterHBaseImpl implements IPcapGetter { public static IPcapGetter getInstance() throws IOException { if (pcapGetterHBase == null) { synchronized (PcapGetterHBaseImpl.class) { if (pcapGetterHBase == null) { pcapGetterHBase = new PcapGetterHBaseImpl(); } } } return pcapGetterHBase; } private  PcapGetterHBaseImpl(); @GET @Path("pcap/test") @Produces("text/html") Response index(); PcapsResponse getPcaps(List<String> keys, String lastRowKey,
      long startTime, long endTime, boolean includeReverseTraffic,
      boolean includeDuplicateLastRow, long maxResultSize); PcapsResponse getPcaps(String key, long startTime, long endTime,
      boolean includeReverseTraffic); PcapsResponse getPcaps(List<String> keys); PcapsResponse getPcaps(String key); static IPcapGetter getInstance(); @VisibleForTesting List<String> removeDuplicateKeys(List<String> keys); static void main(String[] args);  }### Answer:
@SuppressWarnings("unchecked") @Test public void test_getPcaps_withList() throws IOException { String[] keys = { "0a07002b-0a078039-06-1e8b-0087", "0a070025-0a07807a-06-aab8-c360" }; PcapGetterHBaseImpl pcapGetter = (PcapGetterHBaseImpl) PcapGetterHBaseImpl .getInstance(); PcapGetterHBaseImpl spy = Mockito.spy(pcapGetter); List<byte[]> mockPcaps = new ArrayList<byte[]>(); mockPcaps.add(getTestPcapBytes()); }
@SuppressWarnings("unchecked") @Test public void test_getPcaps_withKey() throws IOException { String key = "0a07002b-0a078039-06-1e8b-0087"; PcapGetterHBaseImpl pcapGetter = (PcapGetterHBaseImpl) PcapGetterHBaseImpl .getInstance(); PcapGetterHBaseImpl spy = Mockito.spy(pcapGetter); List<byte[]> mockPcaps = new ArrayList<byte[]>(); mockPcaps.add(getTestPcapBytes()); }
@SuppressWarnings("unchecked") @Test public void test_getPcaps_withKeyAndTimestamps() throws IOException { String key = "0a07002b-0a078039-06-1e8b-0087"; long startTime = 1376782349234555L; long endTime = 1396782349234555L; PcapGetterHBaseImpl pcapGetter = (PcapGetterHBaseImpl) PcapGetterHBaseImpl .getInstance(); PcapGetterHBaseImpl spy = Mockito.spy(pcapGetter); List<byte[]> mockPcaps = new ArrayList<byte[]>(); mockPcaps.add(getTestPcapBytes()); }
@SuppressWarnings("unchecked") @Test public void test_getPcaps_withKey_multiplePcaps() throws IOException { String key = "0a07002b-0a078039-06-1e8b-0087"; PcapGetterHBaseImpl pcapGetter = (PcapGetterHBaseImpl) PcapGetterHBaseImpl .getInstance(); PcapGetterHBaseImpl spy = Mockito.spy(pcapGetter); List<byte[]> mockPcaps = new ArrayList<byte[]>(); mockPcaps.add(getTestPcapBytes()); mockPcaps.add(getTestPcapBytes()); }