### Question:
AppSummaryService { long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of runs is 0"); } return numberRuns; } AppSummaryService(Connection hbaseConnection); List<AppSummary> getNewApps(JobHistoryService jhs, String cluster,
      String user, long startTime, long endTime, int limit); List<AppKey> createNewAppKeysFromResults(Scan scan, long startTime,
      long endTime, int maxCount); boolean aggregateJobDetails(JobDetails jobDetails,
      AggregationConstants.AGGREGATION_TYPE aggType); List<AppSummary> getAllApps(String cluster, String user,
      long startTime, long endTime, int limit);  }### Answer:
@Test(expected = ProcessingException.class) public void testGetNumberRuns() throws IOException { Map<byte[], byte[]> r = new HashMap<byte[], byte[]>(); AppSummaryService appSummaryService = new AppSummaryService(hbaseConnection); assertEquals(0, appSummaryService.getNumberRunsScratch(r)); byte[] key = Bytes.toBytes("abc"); byte[] value = Bytes.toBytes(10L); r.put(key, value); key = Bytes.toBytes("xyz"); value = Bytes.toBytes(102L); r.put(key, value); assertEquals(2, appSummaryService.getNumberRunsScratch(r)); }