@Test
public void testNamePatternInvalidDatePattern() {

  expectedException.expect(IllegalArgumentException.class);
  expectedException.expectMessage(is("the token '%ts:abc%' (position 1 to 8) has invalid "
      + "configuration: the date formatting pattern 'abc' is invalid; for supported patterns, "
      + "consult the javadoc of java.text.SimpleDateFormat"));
  HeapDumpNameFormatter.validate("a%ts:abc%b");
}