Skip to content

Instantly share code, notes, and snippets.

View alexwen's full-sized avatar

Alex Wenckus alexwen

View GitHub Profile
/*
* Copyright (C) 2014 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@alexwen
alexwen / TestPredicateWindow.java
Last active January 5, 2016 19:23 — forked from gjesse/TestPredicateWindow.java
example of using distinctUntilChanged and window to segment an ordered observable into discrete buckets.
package net.loshodges;
import org.junit.Test;
import rx.Observable;
import rx.observers.TestSubscriber;
import rx.schedulers.Schedulers;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadLocalRandom;