private void assumeVisible(Ref ref, boolean visible, Set<String> targets) {
RefControl rc = createStrictMock(RefControl.class);
refMocks.add(rc);
expect(rc.isVisible()).andReturn(visible);
if (visible && !ref.isSymbolic() && !targets.contains(ref.getName())) {
expect(rc.canDelete()).andReturn(true);
}
if (ref.isSymbolic()) {
expect(pc.controlForRef(ref.getTarget().getName())).andReturn(rc);
} else {