StatisticsTypeImpl implements ValidatingStatisticsType { @Override public boolean isValidLongId(int id) { return id < longStatCount; } 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 testIsValidLongId() { int idForLongCounter = statisticsType.nameToId("longCount"); int idForLongCounter2 = statisticsType.nameToId("longCount2"); assertThat(statisticsType.isValidLongId(idForLongCounter)).isEqualTo(true); assertThat(statisticsType.isValidDoubleId(idForLongCounter)).isEqualTo(false); assertThat(statisticsType.isValidLongId(idForLongCounter2)).isEqualTo(true); assertThat(statisticsType.isValidDoubleId(idForLongCounter2)).isEqualTo(false); }