<commit_before>package accepting;

import static accepting.builder.SocialTimeBuilder.aTime;
import static java.util.Arrays.asList;
import static java.util.Collections.sort;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

public class SocialTimeTest {
    private SocialTime originalSocialTime;

    @Before
    public void setUp() {
        originalSocialTime = aTime() //
            .create();
    }

    @Test
    public void createdWithTimestampItPrintsDifferenceToGivenTimestamp() {
        SocialTime timeOfPrinting = aTime() //
            .plusMinutes(5) //
            .create();

        String printedTimestamp = originalSocialTime.printTimestamp(timeOfPrinting);

        assertThat(printedTimestamp, is("5 minutes ago"));
    }

    @Test
    public void createdWithDifferentTimestampItPrintsDifferenceToGivenTimestamp() {
        SocialTime timeOfPrinting = aTime() //
            .plusMinutes(10) //
            .create();

        String printedTimestamp = originalSocialTime.printTimestamp(timeOfPrinting);

        assertThat(printedTimestamp, is("10 minutes ago"));
    }

    @Test
    public void itIsSortedByTimestampLatestFirst() {
        SocialTime time = aTime().create();
        SocialTime laterTime = aTime().plusMinutes(1).create();
        List<SocialTime> times = asList(time, laterTime);

        sort(times);

        assertThat(times, contains(laterTime, time));
    }
}
<commit_msg>Changed test to allow alternative printing of a timestamp when only one minute passed<commit_after>package accepting;

import static accepting.builder.SocialTimeBuilder.aTime;
import static java.util.Arrays.asList;
import static java.util.Collections.sort;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

public class SocialTimeTest {
    private SocialTime originalSocialTime;

    @Before
    public void setUp() {
        originalSocialTime = aTime() //
            .create();
    }

    @Test
    public void createdWithTimestampItPrintsDifferenceToGivenTimestamp() {
        SocialTime timeOfPrinting = aTime() //
            .plusMinutes(5) //
            .create();

        String printedTimestamp = originalSocialTime.printTimestamp(timeOfPrinting);

        assertThat(printedTimestamp, is("5 minutes ago"));
    }

    @Test
    public void createdWithOneMinuteTimestampItPrintsDifferenceToGivenTimestamp() {
        SocialTime timeOfPrinting = aTime() //
            .plusMinutes(1) //
            .create();

        String printedTimestamp = originalSocialTime.printTimestamp(timeOfPrinting);

        assertThat(printedTimestamp, is("1 minute ago"));
    }

    @Test
    public void itIsSortedByTimestampLatestFirst() {
        SocialTime time = aTime().create();
        SocialTime laterTime = aTime().plusMinutes(1).create();
        List<SocialTime> times = asList(time, laterTime);

        sort(times);

        assertThat(times, contains(laterTime, time));
    }
}

{'fraction_non_alphanumeric': 0.09766718506998445, 'fraction_numerical': 0.0037325038880248835, 'mean_word_length': 3.1766233766233767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2356790', 'n_tokens_mistral': 899, 'n_tokens_neox': 861, 'n_words': 191}