/** {@inheritDoc} */
  @Override
  public synchronized Iterable<String> getGroupNames() {
    Collection<String> res = new HashSet<>();

    for (HadoopCounter counter : cntrs.values()) res.add(counter.group());

    return res;
  }
  /**
   * Returns counters iterator for specified group.
   *
   * @param grpName Name of the group to iterate.
   * @return Counters iterator.
   */
  public Iterator<Counter> iterateGroup(String grpName) {
    Collection<Counter> grpCounters = new ArrayList<>();

    for (HadoopLongCounter counter : cntrs.values()) {
      if (grpName.equals(counter.group())) grpCounters.add(new HadoopV2Counter(counter));
    }

    return grpCounters.iterator();
  }