### Question:
AsyncUtil { public static boolean awaitLatchAndThrowInternalErrorExceptionOnInterrupt(CountDownLatch theInitialCollectionLatch, long theTime, TimeUnit theTimeUnit) { try { return theInitialCollectionLatch.await(theTime, theTimeUnit); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new InternalErrorException(e); } } private  AsyncUtil(); static boolean sleep(long theMillis); static boolean awaitLatchAndThrowInternalErrorExceptionOnInterrupt(CountDownLatch theInitialCollectionLatch, long theTime, TimeUnit theTimeUnit); static boolean awaitLatchAndIgnoreInterrupt(CountDownLatch theInitialCollectionLatch, long theTime, TimeUnit theTimeUnit);  }### Answer:
@Test public void testAwaitLatchAndThrowInternalErrorException() { AtomicBoolean outcomeHolder = new AtomicBoolean(false); CountDownLatch latch = new CountDownLatch(1); Thread thread = new Thread(() -> { try { AsyncUtil.awaitLatchAndThrowInternalErrorExceptionOnInterrupt(latch, 10, TimeUnit.SECONDS); } catch (InternalErrorException e) { outcomeHolder.set(true); } }); thread.start(); thread.interrupt(); await().until(()-> outcomeHolder.get()); }