### Question:
BranchedMirrorProjector extends ProjectorWithPlaceholders { public ProjectedNode project( ExecutionContext context, Location location, boolean requiresUpdate ) { assert location != null; if (location.hasPath()) { Path path = location.getPath(); if (path.isRoot()) { if (requiresUpdate && mirrorProjection.isReadOnly()) return null; ProxyNode result = new ProxyNode(mirrorProjection, location, location.with(branchSourcePath), branchSourceUsesSamePath); result.add(isPlaceholder(location)); return result; } ProjectedNode onBranch = isOnBranch(path, location, context); if (onBranch != null) { if (requiresUpdate && branchProjection.isReadOnly()) return null; return onBranch; } if (requiresUpdate && mirrorProjection.isReadOnly()) return null; return new ProxyNode(mirrorProjection, location, location, true); } if (requiresUpdate) { if (branchProjection.isReadOnly()) { if (mirrorProjection.isReadOnly()) return null; return new ProxyNode(mirrorProjection, location, location, true); } if (mirrorProjection.isReadOnly()) { return new ProxyNode(branchProjection, location, location, branchSourceUsesSamePath); } } ProjectedNode result = new ProxyNode(mirrorProjection, location, location, true); result.add(new ProxyNode(branchProjection, location, location, branchSourceUsesSamePath)); return result; } BranchedMirrorProjector( ExecutionContext context,
                             List<Projection> projections,
                             Projection mirrorProjection,
                             Projection branchProjection,
                             Path branchFederatedPath,
                             Path branchSourcePath ); ProjectedNode project( ExecutionContext context,
                                  Location location,
                                  boolean requiresUpdate );  }### Answer:
@Test public void shouldReturnForRootLocationAProxyForMirrorAndPlaceholderForBranch() { Location location = location("/"); ProjectedNode node = projector.project(context, location, false); assertThat(node.isProxy(), is(true)); ProxyNode proxy = node.asProxy(); assertThat(proxy.source(), is(mirrorSourceName)); assertThat(proxy.workspaceName(), is(mirrorWorkspaceName)); assertThat(proxy.location().getPath(), is(path("/"))); assertThat(proxy.hasNext(), is(true)); ProjectedNode next = node.next(); assertThat(next.isPlaceholder(), is(true)); PlaceholderNode placeholder = next.asPlaceholder(); assertThat(placeholder.isPlaceholder(), is(true)); assertThat(placeholder.location().getPath(), is(path("/"))); assertThat(placeholder.children().size(), is(1)); assertThat(placeholder.children().get(0).location().getPath(), is(path("/system"))); assertThat(placeholder.hasNext(), is(false)); }