private static Object invokeConstructor(Class clazz, Class[] params, Object[] values)
      throws Exception {
    Constructor cons = clazz.getDeclaredConstructor(params);
    cons.setAccessible(true);
    return cons.newInstance(values);
  }
Simulates the view as being attached.
core/src/main/java/com/facebook/testing/screenshot/WindowAttachment.java