@Test
public void testNamePatternEnvironmentPropertyTruncatedClosedSpan() {

  environmentVariables.set("my_prop", "abcdefghi");
  final HeapDumpNameFormatter subject =
      new HeapDumpNameFormatter("hda_%env:my_prop[2,4]%.hprof", "my_host", uuidProvider);
  assertThat(subject.format(date), is("hda_cd.hprof"));
}