The CloudEventBuilder should fail with the proper exception (look at CloudEventRWException#newInvalidExtensionName) if the user is trying to add an extension with a bad name (as specified here https://github.com/cloudevents/spec/blob/master/spec.md#attribute-naming-convention)