@Test
public void testNamePatternEnvironmentInvalidTruncation_3() {

  expectedException.expect(IllegalArgumentException.class);
  expectedException.expectMessage(is("the token '%env:abc[,%' (position 4 to 14) has invalid "
      + "configuration: it must match the '(?:(\\w+)(?:\\[(\\d+)?,(\\d+)?])?)?' pattern"));
  HeapDumpNameFormatter.validate("hda_%env:abc[,%.hprof");
}