### Question:
EscapableResourceIdSplitter implements ResourceIdSplitter { @Override public List<String> splitIdIntoElements(String id) { Preconditions.checkNotNull(id, "id argument"); List<String> elements = Lists.newArrayList(); int startOfNextElement = 0; int numConsecutiveEscapeCharacters = 0; char[] idChars = id.toCharArray(); for (int i = 0; i < idChars.length; i++) { if(idChars[i] == SEPARATOR && numConsecutiveEscapeCharacters % 2 == 0) { maybeAddSanitizedElement(new String(idChars, startOfNextElement, i-startOfNextElement), elements); startOfNextElement = i+1; } if (idChars[i] == '\\') { numConsecutiveEscapeCharacters++; } else { numConsecutiveEscapeCharacters = 0; } } maybeAddSanitizedElement(new String(idChars, startOfNextElement, idChars.length - startOfNextElement), elements); return elements; }  @Override List<String> splitIdIntoElements(String id); @Override String joinElementsToId(List<String> elements);  }### Answer:
@Test public void canSplitIdIntoElements() { List<String> els = Lists.newArrayList("a", "b"); assertThat(splitter.splitIdIntoElements("a:b"), is(els)); assertThat(splitter.splitIdIntoElements("a::b"), is(els)); assertThat(splitter.splitIdIntoElements(" a : : b "), is(els)); els = Lists.newArrayList("a"); assertThat(splitter.splitIdIntoElements("a"), is(els)); els = Lists.newArrayList(); assertThat(splitter.splitIdIntoElements(""), is(els)); }