UntypedEvent implements Event, Serializable { public Object getParameter(String parameter) { if (!parameters.containsKey(parameter)) { throw new InvalidKeyException(String.format( "No parameter with name \"%s\" present in the GenericEvent.", parameter )); } return parameters.get(parameter); } UntypedEvent();  UntypedEvent(GenericEvent other); static UntypedEvent fromEvent(GenericEvent event); Object getParameter(String parameter); GenericEvent asEvent();  }
@Test public void getParameter() { UntypedEvent untypedEvent = UntypedEvent.fromEvent(event); assertNotNull(untypedEvent.getParameter("string")); assertNotNull(untypedEvent.getParameter("double")); assertNotNull(untypedEvent.getParameter("long")); assertNotNull(untypedEvent.getParameter("date")); assertNotNull(untypedEvent.getParameter("boolean")); assertNotNull(event.getParameter("string")); assertNotNull(event.getParameter("double")); assertNotNull(event.getParameter("long")); assertNotNull(event.getParameter("date")); assertNotNull(event.getParameter("boolean")); }
@Test(expected = InvalidKeyException.class) public void getParameterNotInParameters() { event.getParameter("notPresent"); }