	@Test
	public void testSingleSelection() {

		String message = StringPrinter.buildStringFromLines(
				"- The table and the tree should keep their selection in sync.",
				"- The table and the tree should not allow multi-selection.",
				"- The categories in the tree should not be selectable.");
		InteractiveTest.testCoat(message, cmp -> {
			TableAndTree tableAndTree = new TableAndTree(cmp, SWT.SINGLE);

			// get the selection of the tree
			RxBox<Optional<TreeNode<String>>> treeSelection = ViewerMisc.<TreeNode<String>> singleSelection(tableAndTree.tree)
					// only names can be selected - not categories
					.enforce(opt -> opt.map(val -> isName(val) ? val : null));

			// sync the tree and the table
			RxBox<Optional<TreeNode<String>>> tableSelection = ViewerMisc.singleSelection(tableAndTree.table);
			Rx.subscribe(treeSelection, tableSelection::set);
			Rx.subscribe(tableSelection, treeSelection::set);
		});
	}