* Checks if given {@link JavaInfo} has canvas/tree {@link FlowContainer} for <code>Widget</code>.
*/
protected static void assertHasWidgetFlowContainer(JavaInfo panel,
boolean forCanvas,
boolean expected) throws Exception {
FlowContainerFactory factory = new FlowContainerFactory(panel, forCanvas);
List<FlowContainer> flowContainers = factory.get();
// check each factory
WidgetInfo button = createButton();
for (FlowContainer flowContainer : flowContainers) {
boolean valid = flowContainer.validateComponent(button);
assertThat(valid).isEqualTo(expected);