FunctionStatsImpl implements FunctionStats { @Override @VisibleForTesting public Statistics getStatistics() { return statistics; } FunctionStatsImpl(String functionId, MeterRegistry meterRegistry, Statistics statistics,
      FunctionServiceStats functionServiceStats); @VisibleForTesting  FunctionStatsImpl(String functionId, MeterRegistry meterRegistry, Statistics statistics,
      FunctionServiceStats aggregateStatistics, long clockResult,
      boolean timeStatisticsEnabledResult); @VisibleForTesting  FunctionStatsImpl(String functionId, MeterRegistry meterRegistry, Statistics statistics,
      FunctionServiceStats aggregateStatistics, long clockResult,
      boolean timeStatisticsEnabledResult, Timer successTimerResult, Timer registerFailureResult); private  FunctionStatsImpl(String functionId, MeterRegistry meterRegistry, Statistics statistics,
      FunctionServiceStats aggregateStatistics, LongSupplier clock,
      BooleanSupplier timeStatisticsEnabled,
      BiFunction<String, MeterRegistry, Timer> registerSuccessTimerFunction,
      BiFunction<String, MeterRegistry, Timer> registerFailureTimerFunction); @Override void close(); @Override boolean isClosed(); @Override int getFunctionExecutionsCompleted(); @Override int getFunctionExecutionsRunning(); @Override void incResultsReturned(); @Override int getResultsReceived(); @Override void incResultsReceived(); @Override int getFunctionExecutionCalls(); @Override long startFunctionExecution(boolean haveResult); @Override void endFunctionExecution(long startTime, boolean haveResult); @Override void endFunctionExecutionWithException(long startTime, boolean haveResult); @Override @VisibleForTesting Statistics getStatistics(); @Override @VisibleForTesting MeterRegistry getMeterRegistry(); static StatisticsType getStatisticsType();  }
@Test public void getStatistics_returnsGivenStatistics() { Statistics statisticsPassedToConstructor = mock(Statistics.class); FunctionStats functionStats = new FunctionStatsImpl(FUNCTION_ID, meterRegistry, statisticsPassedToConstructor, functionServiceStats); assertThat(functionStats.getStatistics()) .isSameAs(statisticsPassedToConstructor); }