class SubjectIdReplacementDefinition implements Function<DittoHeaders, String> {

    @Override
    public String apply(final DittoHeaders dittoHeaders) {
        requireNonNull(dittoHeaders);

        return dittoHeaders.getAuthorizationContext().getFirstAuthorizationSubject()
                .map(AuthorizationSubject::getId)
                .orElseThrow(() -> new IllegalStateException("AuthorizationContext must be available when this " +
                        "function is applied!"));
    }

    private  SubjectIdReplacementDefinition();

}