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 SessionWindow otherWindow = (SessionWindow) other;
        return !(otherWindow.endMs < startMs || endMs < otherWindow.startMs);
    }
@Test
    public void shouldOverlapIfOtherWindowContainsThisWindow() {
        /*
         * This:        [-------]
         * Other: [------------------]
         */
        assertTrue(window.overlap(new SessionWindow(0, end)));
        assertTrue(window.overlap(new SessionWindow(0, end + 1)));
        assertTrue(window.overlap(new SessionWindow(0, 150)));

        assertTrue(window.overlap(new SessionWindow(start - 1, end)));
        assertTrue(window.overlap(new SessionWindow(start - 1, end + 1)));
        assertTrue(window.overlap(new SessionWindow(start - 1, 150)));

        assertTrue(window.overlap(new SessionWindow(start, end)));
        assertTrue(window.overlap(new SessionWindow(start, end + 1)));
        assertTrue(window.overlap(new SessionWindow(start, 150)));
    }