ComponentEventBusUtil { @SuppressWarnings("unchecked") public static <T extends ComponentEvent<?>> Constructor<T> getEventConstructor( Class<T> eventType) { return (Constructor<T>) cache.get(eventType).eventConstructor; } private  ComponentEventBusUtil(); static LinkedHashMap<String, Class<?>> getEventDataExpressions(
            Class<? extends ComponentEvent<?>> eventType); @SuppressWarnings("unchecked") static Constructor<T> getEventConstructor(
            Class<T> eventType); static boolean isDomEventConstructor(Constructor<?> constructor);  }
@Test public void domEvent_innerEventClass() { try { ComponentEventBusUtil.getEventConstructor(InnerClass.class); } catch (IllegalArgumentException exception) { Assert.assertEquals("Cannot instantiate '" + InnerClass.class.getName() + "'. " + "Make sure the class is static if it is an inner class.", exception.getMessage()); } }
@Test public void domEvent_nestedEventClass() { Constructor<NestedClass> ctor = ComponentEventBusUtil .getEventConstructor(NestedClass.class); Assert.assertNotNull(ctor); }
@Test public void domEvent_localEventClass() { @DomEvent("dom-event") class LocalClass extends ComponentEvent<Component> { public LocalClass(Component source, boolean fromClient) { super(source, fromClient); } } try { ComponentEventBusUtil.getEventConstructor(LocalClass.class); } catch (IllegalArgumentException exception) { Assert.assertEquals( "Cannot instantiate local class '" + LocalClass.class.getName() + "'. " + "Move class declaration outside the method.", exception.getMessage()); } }