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 cannotCompareSessionWindowWithDifferentWindowType() {
        assertThrows(IllegalArgumentException.class, () -> window.overlap(timeWindow));
    }