A count down latch with a starting count of 1?

On Wednesday, 12 February 2014, Jon Chambers <notifications@github.com>
wrote:

> In src/test/java/com/relayrides/pushy/apns/ApnsConnectionPoolTest.java:
>
> > +			pool.addConnection(secondConnection);
> > +
> > +			assertNotEquals(firstConnection, secondConnection);
> > +			assertNotEquals("Subsequent calls to getNextConnection should return different connections.",
> > +					pool.getNextConnection(), pool.getNextConnection());
> > +		}
> > +
> > +		{
> > +			final ApnsConnectionPool<SimpleApnsPushNotification> pool =
> > +					new ApnsConnectionPool<SimpleApnsPushNotification>();
> > +
> > +			new Thread(new Runnable() {
> > +
> > +				public void run() {
> > +					try {
> > +						Thread.sleep(50);
>
> If anybody can think of a less hacky way to do this, I'm all ears (
> testWaitForEmptyPool has a similar problem). Basically, I want to make
> sure we actually block on pool.getNextConnection(), but once we've hit it
> and blocked, I don't know of any good way to signal that it's happened.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/relayrides/pushy/pull/47/files#r9689598>
> .
>