StatisticsTypeImpl implements ValidatingStatisticsType { @Override public int nameToId(String name) { return nameToDescriptor(name).getId(); } StatisticsTypeImpl(String name, String description, StatisticDescriptor[] stats); static StatisticsType[] fromXml(Reader reader, StatisticsTypeFactory factory); @Override String getName(); @Override String getDescription(); @Override StatisticDescriptor[] getStatistics(); @Override int nameToId(String name); @Override StatisticDescriptor nameToDescriptor(String name); int getLongStatCount(); int getDoubleStatCount(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object o); @Override boolean isValidLongId(int id); @Override boolean isValidDoubleId(int id);  }
@Test public void testIdsAreAssignedInGroupsByType() { int idForIntCounter = statisticsType.nameToId("intCount"); int idForLongCounter = statisticsType.nameToId("longCount"); int idForLongCounter2 = statisticsType.nameToId("longCount2"); int idForDoubleCounter = statisticsType.nameToId("doubleCount"); assertThat(idForIntCounter).isLessThan(idForDoubleCounter); assertThat(idForLongCounter).isLessThan(idForDoubleCounter); assertThat(idForLongCounter2).isLessThan(idForDoubleCounter); }