/**
* Locates a component implementing the required class on the supplied page.
*/
public static <T> T getFrom(Page page, final Class<T> cls) {
final Object[] pComponent = new Object[1];
page.visitChildren(new DeepChildFirstVisitor() {
@Override
public void component(Component component, IVisit<Void> visit) {
if(cls.isAssignableFrom(component.getClass())) {
pComponent[0] = component;
visit.stop();