@Test(dataProvider="createTransferableTests")
public void testCreateTransferable(TreePath[] paths, View[] views) throws UnsupportedFlavorException, IOException {
when(tree.getSelectionPaths()).thenReturn(paths);
ViewRoleSelection selection = (ViewRoleSelection) handler.createTransferable(tree);
if (paths.length == 0) {
assertNull(selection);
} else {
assertEquals(selection.getTransferDataFlavors().length, 1);
DataFlavor flavor = selection.getTransferDataFlavors()[0];
assertSame(flavor.getRepresentationClass(), View.class);
View[] selectedViewRoles = (View[]) selection.getTransferData(flavor);
assertEquals(selectedViewRoles.length, views.length);
List<View> expectedViews = Arrays.asList(views);
for (View view : selectedViewRoles) {
assertTrue(expectedViews.contains(view));