private static Consumer<Statistics> withType(StatisticsType type) {
    return statistics -> when(statistics.getType()).thenReturn(type);
  }
Creates a consumer that assigns the given statistics type to a mock statistics.
geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsRegistryTest.java