### Question:
StandardEvent implements Event { @Override public void validate() throws IllegalStateException { final int numProvidedFields = eventFields.size(); final int numRequiredFields = eventType.getFieldNames().size(); if (numProvidedFields != numRequiredFields) { throw new IllegalStateException(numRequiredFields + " fields were required, but only " + numProvidedFields + " were provided"); } for (int i=0; i < numRequiredFields; i++) { final EventFieldName required = eventType.getFieldNames().get(i); final EventFieldName provided = eventFields.get(i).getName(); if (!required.equals(provided)) { throw new IllegalStateException("Expected " + required.name() + ", but found " + provided.name()); } } } private  StandardEvent(final Builder builder); @Override EventType getEventType(); @Override List<EventField> getFields(); @Override EventField getField(final EventFieldName fieldName); @Override void validate(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test(expected = IllegalStateException.class) public void testInvalidEvent() { final Event event = new StandardEvent.Builder() .eventType(EventType.CREATE_BUCKET) .build(); event.validate(); }