class CountingBloomFilterBasedWindow {

    public ComplexEvent getLast(Boolean remove) {
        if (remove) {
            StreamEvent streamEvent = eventQueue.poll();
            filter.delete(new Key((byte[]) streamEvent.getAttribute(joinAttributeId).toString()
                    .getBytes()));
            return streamEvent;
        } else {
            return eventQueue.peek();
        }
    }

}