@Test
public void matcherState() throws Exception {

  when(context.getAttributes())
      .thenReturn(attributesMap);
  when(attributesMap.require(TokenMatcher.State.class))
      .thenReturn(state);
  TokenMatcher.State testState = P2PathUtils.matcherState(context);
  assertThat(testState, instanceOf(TokenMatcher.State.class));
}