@Test
  public void testDestroyUnallocatedStatistics() throws Exception {
    final StatArchiveDescriptor archiveDescriptor =
        new StatArchiveDescriptor.Builder().setArchiveName(archiveFileName).setSystemId(1)
            .setSystemStartTime(WRITER_INITIAL_DATE_MILLIS - 2000)
            .setSystemDirectoryPath(testName.getMethodName())
            .setProductDescription(getClass().getSimpleName()).build();
    final StatArchiveWriter writer = new TestStatArchiveWriter(archiveDescriptor);

    final StatisticsType statsType = createDummyStatisticsType();
    final ResourceType rt = new ResourceType(0, statsType);
    final Statistics statistics = mock(Statistics.class);
    final ResourceInstance ri = new ResourceInstance(0, statistics, rt);

    writer.sampled(WRITER_INITIAL_DATE_MILLIS + 1000, Collections.singletonList(ri));

    writer.destroyedResourceInstance(ri);
    writer.close();

    // Verify StatArchiveReader.update returns cleanly, without throwing an exception
    final StatArchiveReader reader =
        new StatArchiveReader(new File[] {new File(archiveFileName)}, null, false);
    reader.update();
    reader.close();
  }
Control which helps verify fix for bug #45377.
geode-core/src/integrationTest/java/org/apache/geode/internal/statistics/StatArchiveWriterReaderIntegrationTest.java