// Path: src/main/java/com/github/quiram/buildhotspots/DateToFrequencyTransformer.java
// public class DateToFrequencyTransformer {
//     private LocalDateTime oldest;
//     private LocalDateTime mostRecent;
// 
// 
//     public LocalDateTime getOldestDate() {
//         return oldest;
//     }
// 
//     public void add(LocalDateTime dateTime) {
//         if (this.oldest == null || dateTime.isBefore(this.oldest)) {
//             this.oldest = dateTime;
//         }
// 
//         if (this.mostRecent == null || dateTime.isAfter(this.mostRecent)) {
//             mostRecent = dateTime;
//         }
//     }
// 
//     public LocalDateTime getMostRecentDate() {
//         return mostRecent;
//     }
// 
//     public long getFrequencyFor(LocalDateTime dateTime) {
//         if (oldest == null) {
//             throw new IllegalStateException("Transformer is empty.");
//         }
// 
//         if (oldest == mostRecent) {
//             throw new IllegalStateException("Transformer only has one element.");
//         }
// 
//         if (dateTime.isBefore(oldest) || dateTime.isAfter(mostRecent)) {
//             throw new IllegalArgumentException("Date to calculate frequency from must be within range of dates previously inserted in the transformer.");
//         }
// 
//         long totalRange = oldest.until(mostRecent, SECONDS);
//         long datePosition = oldest.until(dateTime, SECONDS);
// 
//         return datePosition * 100 / totalRange;
//     }
// }


import com.github.quiram.buildhotspots.DateToFrequencyTransformer;
import org.junit.Before;
import org.junit.Test;
import java.time.LocalDateTime;
import static java.time.LocalDateTime.now;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertEquals;
package com.github.quiram.buildhotspots.datetofrequencytransformertest;




public class TwoElementsInDateToFrequencyTransformerTest extends DateToFrequencyTransformerTest {

    private LocalDateTime older;
    private LocalDateTime later;

    @Before
    @Override
    public void setUp() {
        super.setUp();
        older = now();
        later = older.plusDays(1);
        transformer.add(older);
        transformer.add(later);
    }

    @Test
    public void oldestDateWhenFirstIsOlderReturnsFirst() {
        assertEquals(older, transformer.getOldestDate());
    }

    @Test
    public void mostRecentDateWhenSecondIsOlderReturnsFirst() {
// Path: src/main/java/com/github/quiram/buildhotspots/DateToFrequencyTransformer.java
// public class DateToFrequencyTransformer {
//     private LocalDateTime oldest;
//     private LocalDateTime mostRecent;
// 
// 
//     public LocalDateTime getOldestDate() {
//         return oldest;
//     }
// 
//     public void add(LocalDateTime dateTime) {
//         if (this.oldest == null || dateTime.isBefore(this.oldest)) {
//             this.oldest = dateTime;
//         }
// 
//         if (this.mostRecent == null || dateTime.isAfter(this.mostRecent)) {
//             mostRecent = dateTime;
//         }
//     }
// 
//     public LocalDateTime getMostRecentDate() {
//         return mostRecent;
//     }
// 
//     public long getFrequencyFor(LocalDateTime dateTime) {
//         if (oldest == null) {
//             throw new IllegalStateException("Transformer is empty.");
//         }
// 
//         if (oldest == mostRecent) {
//             throw new IllegalStateException("Transformer only has one element.");
//         }
// 
//         if (dateTime.isBefore(oldest) || dateTime.isAfter(mostRecent)) {
//             throw new IllegalArgumentException("Date to calculate frequency from must be within range of dates previously inserted in the transformer.");
//         }
// 
//         long totalRange = oldest.until(mostRecent, SECONDS);
//         long datePosition = oldest.until(dateTime, SECONDS);
// 
//         return datePosition * 100 / totalRange;
//     }
// }


// Path: src/test/java/com/github/quiram/buildhotspots/datetofrequencytransformertest/TwoElementsInDateToFrequencyTransformerTest.java
import com.github.quiram.buildhotspots.DateToFrequencyTransformer;
import org.junit.Before;
import org.junit.Test;
import java.time.LocalDateTime;
import static java.time.LocalDateTime.now;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertEquals;

package com.github.quiram.buildhotspots.datetofrequencytransformertest;




public class TwoElementsInDateToFrequencyTransformerTest extends DateToFrequencyTransformerTest {

    private LocalDateTime older;
    private LocalDateTime later;

    @Before
    @Override
    public void setUp() {
        super.setUp();
        older = now();
        later = older.plusDays(1);
        transformer.add(older);
        transformer.add(later);
    }

    @Test
    public void oldestDateWhenFirstIsOlderReturnsFirst() {
        assertEquals(older, transformer.getOldestDate());
    }

    @Test
    public void mostRecentDateWhenSecondIsOlderReturnsFirst() {
        DateToFrequencyTransformer transformer = new DateToFrequencyTransformer();