@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%%%"));
}