StatisticsTypeImpl implements ValidatingStatisticsType { @Override public boolean isValidDoubleId(int id) { return longStatCount <= id && id < longStatCount + doubleStatCount; } 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 testIsValidDoubleId() { int idForDoubleCounter = statisticsType.nameToId("doubleCount"); assertThat(statisticsType.isValidLongId(idForDoubleCounter)).isEqualTo(false); assertThat(statisticsType.isValidDoubleId(idForDoubleCounter)).isEqualTo(true); }