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);
    }
Check if the given window overlaps with this window.

@param other another window
@return {@code true} if {@code other} overlaps with this window&mdash;{@code false} otherwise
@throws IllegalArgumentException if the {@code other} window has a different type than {@code this} window
streams/src/main/java/org/apache/kafka/streams/kstream/internals/SessionWindow.java