FakeLock implements Lock { @Override public Condition newCondition() { throw new UnsupportedOperationException(); } private  FakeLock(); @Override void lock(); @Override void unlock(); @Override void lockInterruptibly(); @Override boolean tryLock(); @Override boolean tryLock(long time, TimeUnit unit); @Override Condition newCondition(); static final Lock INSTANCE; }
@Test(expected = UnsupportedOperationException.class) public void newCondition() throws Exception { FakeLock.INSTANCE.newCondition(); }