private static Consumer<Statistics> withTextId(String textId) {
    return statistics -> when(statistics.getTextId()).thenReturn(textId);
  }
Creates a consumer that assigns the given text ID to a mock statistics.
geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsRegistryTest.java