<commit_before>package com.timgroup.eventstore.memory;

import com.timgroup.eventstore.api.EventCategoryReader;
import com.timgroup.eventstore.api.EventReader;
import com.timgroup.eventstore.api.EventSource;
import com.timgroup.eventstore.api.EventStreamReader;
import com.timgroup.eventstore.api.EventStreamWriter;
import com.timgroup.eventstore.api.PositionCodec;
import com.timgroup.tucker.info.Component;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;

import static java.util.Objects.requireNonNull;

public class InMemoryEventSource implements EventSource {
    private final JavaInMemoryEventStore eventStore;

    public InMemoryEventSource(JavaInMemoryEventStore eventStore) {
        this.eventStore = requireNonNull(eventStore);
    }

    @Override
    @Nonnull
    public EventReader readAll() {
        return eventStore;<commit_msg>SteveH: secondary constructors to simplify creating in-memory event source<commit_after>package com.timgroup.eventstore.memory;

import com.timgroup.eventstore.api.EventCategoryReader;
import com.timgroup.eventstore.api.EventReader;
import com.timgroup.eventstore.api.EventSource;
import com.timgroup.eventstore.api.EventStreamReader;
import com.timgroup.eventstore.api.EventStreamWriter;
import com.timgroup.eventstore.api.PositionCodec;
import com.timgroup.tucker.info.Component;

import javax.annotation.Nonnull;
import java.time.Clock;
import java.util.Collection;
import java.util.Collections;

import static java.util.Objects.requireNonNull;

public class InMemoryEventSource implements EventSource {
    private final JavaInMemoryEventStore eventStore;

    public InMemoryEventSource(JavaInMemoryEventStore eventStore) {
        this.eventStore = requireNonNull(eventStore);
    }

    public InMemoryEventSource(Clock clock) {
        this(new JavaInMemoryEventStore(clock));
    }

    public InMemoryEventSource() {
        this(Clock.systemDefaultZone());
    }

    @Override
    @Nonnull
    public EventReader readAll() {
        return eventStore;
{'fraction_non_alphanumeric': 0.08171206225680934, 'fraction_numerical': 0.0, 'mean_word_length': 5.140298507462687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2772228', 'n_tokens_mistral': 574, 'n_tokens_neox': 570, 'n_words': 109}