@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;
    }
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/TimeWindow.java