@Test
public void testBuildWithRetainUri() {

    final NamespaceMappingRequest request = builder()
            .withRetainUri(NamespaceRegistry.NAMESPACE_JCR)
            .withRetainUri(NS_FOO_URI)
            .build();
    assertTrue("foo mapping is retained",
            request.resolveToJcrNs(mapping).stream().flatMap(Result::stream)
                    .anyMatch(inferTest1(NS_FOO::equals)));
    assertFalse("non-foo mappings are not retained",
            request.resolveToJcrNs(mapping).stream().flatMap(Result::stream)
                    .anyMatch(inferTest1(NS_FOO::equals).negate()));
}