### Question:
HeapDumpNameFormatter { static List<String> splitInParts(final String pattern) { final Matcher matcher = SPLIT_PATTERN_IN_PARTS.matcher(pattern); final List<String> res = new ArrayList<>(); while (matcher.find()) { res.add(matcher.group()); } return res; } HeapDumpNameFormatter(final String pattern, final String hostName,
                        final Provider<UUID> uuidProvider);   HeapDumpNameFormatter(final String pattern, final String hostName); static void validate(final String pattern); String format(final Date timestamp);  }### Answer:
@Test public void testSplitInParts() { assertThat(splitInParts(" a "), contains(" a ")); assertThat(splitInParts("a%"), contains("a", "%")); assertThat(splitInParts("a%b"), contains("a", "%b")); assertThat(splitInParts("%a"), contains("%a")); assertThat(splitInParts("%a%%"), contains("%a%%")); assertThat(splitInParts("%a%"), contains("%a%")); assertThat(splitInParts("a%%b"), contains("a%%b")); assertThat(splitInParts("a%b%"), contains("a", "%b%")); assertThat(splitInParts("a%%b%c%d"), contains("a%%b", "%c%", "d")); assertThat(splitInParts("a%b%%c%d"), contains("a", "%b%%c%", "d")); assertThat(splitInParts("a%b%%c%d%"), contains("a", "%b%%c%", "d", "%")); assertThat(splitInParts("a%b%%c%d%%"), contains("a", "%b%%c%", "d%%")); assertThat(splitInParts("%%a"), contains("%%a")); assertThat(splitInParts("a%%"), contains("a%%")); assertThat(splitInParts("%%%"), contains("%%", "%")); assertThat(splitInParts("%%%%"), contains("%%%%")); assertThat(splitInParts("%%a%%"), contains("%%a%%")); assertThat(splitInParts("%%%a%%%"), contains("%%", "%a%%%")); }