ThreadFactory wrapped = EasyMock.createMock(ThreadFactory.class);
Runnable r = EasyMock.createMock(Runnable.class);
Thread.UncaughtExceptionHandler handler = EasyMock
.createMock(Thread.UncaughtExceptionHandler.class);
Thread t = new Thread();
EasyMock.expect(wrapped.newThread(r)).andReturn(t);
EasyMock.replay(wrapped, r, handler);
BasicThreadFactory factory = builder.wrappedFactory(wrapped)
.uncaughtExceptionHandler(handler).build();
assertSame("Wrong thread", t, factory.newThread(r));
assertEquals("Wrong exception handler", handler, t