/**
* @param delegate Type declaration to get a JSON type name for (must not be null).
* @return JSON type name for the given declaration.
*/
public static String getTypeName(final TypeDeclaration delegate) {
JsonName jsonName = delegate.getAnnotation(JsonName.class);
return jsonName == null ? delegate.getSimpleName() : jsonName.value();
}