StatisticsImpl implements SuppliableStatistics { @Override public long getNumericId() { return numericId; } StatisticsImpl(StatisticsType type, String textId, long numericId, long uniqueId,
      int osStatFlags, StatisticsManager statisticsManager);   StatisticsImpl(StatisticsType type, String textId, long numericId, long uniqueId,
      int osStatFlags, StatisticsManager statisticsManager, StatisticsLogger statisticsLogger); @Override int nameToId(String name); @Override StatisticDescriptor nameToDescriptor(String name); @Override void close(); @Override boolean isClosed(); @Override StatisticsType getType(); @Override String getTextId(); @Override long getNumericId(); @Override long getUniqueId(); @Override void setInt(String name, int value); @Override void setInt(StatisticDescriptor descriptor, int value); @Override void setInt(int id, int value); @Override void setLong(String name, long value); @Override void setLong(StatisticDescriptor descriptor, long value); @Override void setLong(int id, long value); @Override void setDouble(String name, double value); @Override void setDouble(StatisticDescriptor descriptor, double value); @Override void setDouble(int id, double value); @Override int getInt(String name); @Override int getInt(StatisticDescriptor descriptor); @Override int getInt(int id); @Override long getLong(String name); @Override long getLong(StatisticDescriptor descriptor); @Override long getLong(int id); @Override double getDouble(String name); @Override double getDouble(StatisticDescriptor descriptor); @Override double getDouble(int id); @Override Number get(StatisticDescriptor descriptor); @Override Number get(String name); @Override long getRawBits(StatisticDescriptor descriptor); @Override long getRawBits(String name); @Override void incInt(String name, int delta); @Override void incInt(StatisticDescriptor descriptor, int delta); @Override void incInt(int id, int delta); @Override void incLong(String name, long delta); @Override void incLong(StatisticDescriptor descriptor, long delta); @Override void incLong(int id, long delta); @Override void incDouble(String name, double delta); @Override void incDouble(StatisticDescriptor descriptor, double delta); @Override void incDouble(int id, double delta); @Override IntSupplier setIntSupplier(final int id, final IntSupplier supplier); @Override IntSupplier setIntSupplier(final String name, final IntSupplier supplier); @Override IntSupplier setIntSupplier(final StatisticDescriptor descriptor,
      final IntSupplier supplier); @Override LongSupplier setLongSupplier(final int id, final LongSupplier supplier); @Override LongSupplier setLongSupplier(final String name, final LongSupplier supplier); @Override LongSupplier setLongSupplier(final StatisticDescriptor descriptor,
      final LongSupplier supplier); @Override DoubleSupplier setDoubleSupplier(final int id, final DoubleSupplier supplier); @Override DoubleSupplier setDoubleSupplier(final String name, final DoubleSupplier supplier); @Override DoubleSupplier setDoubleSupplier(final StatisticDescriptor descriptor,
      final DoubleSupplier supplier); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override abstract boolean isAtomic(); @Override int updateSuppliedValues();  }
@Test public void positiveNumericId_usesGivenNumericId() { int positiveNumericId = 21; statistics = new SimpleStatistics(statisticsType, ANY_TEXT_ID, positiveNumericId, ANY_UNIQUE_ID, ANY_OS_STAT_FLAGS, statisticsManager); assertThat(statistics.getNumericId()).isEqualTo(positiveNumericId); }
@Test public void negativeNumericId_usesGivenNumericId() { int negativeNumericId = -21; statistics = new SimpleStatistics(statisticsType, ANY_TEXT_ID, negativeNumericId, ANY_UNIQUE_ID, ANY_OS_STAT_FLAGS, statisticsManager); assertThat(statistics.getNumericId()).isEqualTo(negativeNumericId); }
@Test public void zeroNumericId_usesPidFromStatisticsManager() { int pidFromStatisticsManager = 42; when(statisticsManager.getPid()).thenReturn(pidFromStatisticsManager); int zeroNumericId = 0; statistics = new SimpleStatistics(statisticsType, ANY_TEXT_ID, zeroNumericId, ANY_UNIQUE_ID, ANY_OS_STAT_FLAGS, statisticsManager); assertThat(statistics.getNumericId()).isEqualTo(pidFromStatisticsManager); }