try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
- ReadWriteLockTest.fail("ReadLocker thread was interrupted." +
+ throw new RuntimeException("ReadLocker thread was interrupted." +
Thread.currentThread());
}
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
- ReadWriteLockTest.fail("WriteLocker thread was interrupted: " +
+ throw new RuntimeException("WriteLocker thread was interrupted: " +
Thread.currentThread());
}
public class PairTest extends TestCase {
public void testPair() {
Pair<Integer, String> pair = new Pair<Integer, String>(10, "hello");
- assertEquals(new Integer(10), pair.getFirst());
+ assertEquals(Integer.valueOf(10), pair.getFirst());
assertEquals("hello", pair.getSecond());
Pair<Integer, String> pair2 = new Pair<Integer, String>(pair);