public Collection<StatusSummary> getSummaryPerStatus() {
    return Collections.unmodifiableCollection(mSummaryPerStatus);
  }
@Test
  public void testJobServiceSummaryBuilder() {

    Collection<StatusSummary> summaryPerStatus = mSummary.getSummaryPerStatus();

    assertEquals("Unexpected length of summaryPerStatus",
            Status.values().length, summaryPerStatus.size());

    Map<Status, Long> groupByStatus = Maps.newHashMap();

    for (StatusSummary statusSummary : summaryPerStatus) {
      groupByStatus.put(statusSummary.getStatus(), statusSummary.getCount());
    }

    assertEquals("Unexpected length after grouping by status, "
                    + "perhaps there were duplicate status in StatusSummary",
            Status.values().length, summaryPerStatus.size());

    for (Status status : groupByStatus.keySet()) {
      long count = groupByStatus.get(status);
      switch (status) {
        case COMPLETED:
          assertEquals("COMPLETED count unexpected", 2L, count);
          break;
        case FAILED:
          assertEquals("FAILED count unexpected", 3L, count);
          break;
        case RUNNING:
          assertEquals("RUNNING count unexpected", 2L, count);
          break;
        default:
          assertEquals("Unexpected status having count value: " + status, 0L, count);
      }
    }
  }