@Test
public void testPeek004() throws Exception {

    int capacity = 1;
    final long sleeptime = 1000;
    final CountDownLatch threadSync = new CountDownLatch(1);
    final ArrayBlockingQueueEx<DataValueObject> queue = new ArrayBlockingQueueEx<DataValueObject>(capacity);
    // 別スレッドでpeekを実行（キューが空なので待ちになる）
    ErrorFeedBackThread thread01 = new ErrorFeedBackThread() {
        @Override
        public void doRun() throws Exception {
            // 待ち状態をつくる
            long timeStart = System.currentTimeMillis();
            threadSync.countDown();
            DataValueObject result = queue.peek();
            long timeEnd = System.currentTimeMillis();
            // resultの確認
            assertNull(result);
            // 処理時間の確認（interruptによって終了したか）
            long timeDiff = timeEnd - timeStart;
            // 約1000ミリ秒の待ち確認(50ミリ秒の誤差を許容)
            if (timeDiff < (sleeptime - 50)) {
                throw new RuntimeException("An exception did not occur within a definite period of time.");
            }
        }
    };
    thread01.start();
    // 少し待つ
    threadSync.await();
    TimeUnit.MILLISECONDS.sleep(sleeptime);
    // 割り込み
    thread01.interrupt();
    thread01.throwErrorOrExceptionIfThrown();
}