### Question:
RawStoreProxy implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { Deadline.registerIfNot(socketTimeout); boolean isTimerStarted = Deadline.startTimer(method.getName()); try { return method.invoke(base, args); } finally { if (isTimerStarted) { Deadline.stopTimer(); } } } catch (UndeclaredThrowableException e) { throw e.getCause(); } catch (InvocationTargetException e) { throw e.getCause(); } } protected  RawStoreProxy(Configuration hiveConf, Configuration conf,
      Class<? extends RawStore> rawStoreClass, int id); static RawStore getProxy(Configuration hiveConf, Configuration conf, String rawStoreClassName,
      int id); @Override Object invoke(Object proxy, Method method, Object[] args); Configuration getConf();  }### Answer:
@Test public void testExceptionDispatch() throws Throwable { Configuration conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.CLIENT_SOCKET_TIMEOUT, 10, TimeUnit.MILLISECONDS); RawStoreProxy rsp = new RawStoreProxy(conf, conf, TestStore.class, 1); try { rsp.invoke(null, TestStore.class.getMethod("exceptions"), new Object[] {}); fail("an exception is expected"); } catch (IllegalStateException ise) { } Thread.sleep(20); rsp.invoke(null, TestStore.class.getMethod("noopMethod"), new Object[] {}); }