private Entry<String, NotificationConfiguration> createLambdaConfig(String id,
                                                                        List<String> events,
                                                                        String functionArn,
                                                                        String invocationRole,
                                                                        Filter filter) {
        NotificationConfiguration config;
        if (invocationRole == null) {
            config = new LambdaConfiguration(functionArn, events.toArray(new String[0]));
        } else {
            config = new CloudFunctionConfiguration(invocationRole, functionArn, events.toArray(new String[0]));
        }
        return new SimpleEntry<String, NotificationConfiguration>(id, config.withFilter(filter));
    }
CloudFunctionConfiguration is a little different then Topic or Queue Configurations and thus
doesn't fit nicely as a subclass of {@link NotificationConfigurationStaxUnmarshaller}. A
CloudFunctionConfiguration element may be unmarshalled into two different classes based on
presence of the InvocationRole attribute. If InvocationRole is present we unmarshall into the
legacy {@link CloudFunctionConfiguration}, otherwise we unmarshall into
{@link LambdaConfiguration}.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/LambdaConfigurationStaxUnmarshaller.java