@Test
public void testBuildWithRetainBuiltins() {

    final NamespaceMappingRequest request = builder()
            .withRetainBuiltins(true)
            .withRetainPrefix(NamespaceRegistry.PREFIX_JCR)
            .withRetainPrefix(NS_FOO_PREFIX)
            .build();
    request.resolveToJcrNs(mapping).stream().filter(Result::isFailure).findFirst().map(Result::teeLogError);
    assertTrue("jcr mapping is retained",
            request.resolveToJcrNs(mapping).stream().flatMap(Result::stream)
                    .map(JcrNs::getPrefix)
                    .anyMatch(inferTest1(NamespaceRegistry.PREFIX_JCR::equals)));
    assertTrue("foo mapping is retained",
            request.resolveToJcrNs(mapping).stream().flatMap(Result::stream)
                    .anyMatch(inferTest1(NS_FOO::equals)));
    assertFalse("bar mapping is not retained",
            request.resolveToJcrNs(mapping).stream().flatMap(Result::stream)
                    .anyMatch(inferTest1(NS_BAR::equals)));
}