@Test
public void getJsonKeyIteratorReturnsExpected() {

    final JsonPointer barResourcePath = barResourceKey.getResourcePath();
    final Collection<JsonKey> expectedJsonKeys = new ArrayList<>(1 + barResourcePath.getLevelCount());
    expectedJsonKeys.add(JsonFactory.newKey(barResourceKey.getResourceType()));
    barResourcePath.forEach(expectedJsonKeys::add);
    final Iterator<JsonKey> jsonKeyIterator = PolicyTrie.getJsonKeyIterator(barResourceKey);
    assertThat(jsonKeyIterator).toIterable().containsExactlyElementsOf(expectedJsonKeys);
}