@Override
    public boolean overlap(final Window other) throws IllegalArgumentException {
        if (getClass() != other.getClass()) {
            throw new IllegalArgumentException("Cannot compare windows of different type. Other window has type "
                + other.getClass() + ".");
        }
        final TimeWindow otherWindow = (TimeWindow) other;
        return startMs < otherWindow.endMs && otherWindow.startMs < endMs;
    }
@Test
    public void shouldOverlapIfOtherWindowEndIsWithinThisWindow() {
        /*
         * This:        [-------)
         * Other: [---------)
         */
        assertTrue(window.overlap(new TimeWindow(0, start + 1)));
        assertTrue(window.overlap(new TimeWindow(0, 75)));
        assertTrue(window.overlap(new TimeWindow(0, end - 1)));

        assertTrue(window.overlap(new TimeWindow(start - 1, start + 1)));
        assertTrue(window.overlap(new TimeWindow(start - 1, 75)));
        assertTrue(window.overlap(new TimeWindow(start - 1, end - 1)));
    }