### Question:
TransactionHookManager { public static void registerHook(TransactionHook transactionHook) { if (transactionHook == null) { throw new NullPointerException("transactionHook must not be null"); } List<TransactionHook> transactionHooks = LOCAL_HOOKS.get(); if (transactionHooks == null) { LOCAL_HOOKS.set(new ArrayList<>()); } LOCAL_HOOKS.get().add(transactionHook); } private  TransactionHookManager(); static List<TransactionHook> getHooks(); static void registerHook(TransactionHook transactionHook); static void clear();  }### Answer:
@Test public void testRegisterHook() { TransactionHookAdapter transactionHookAdapter = new TransactionHookAdapter(); TransactionHookManager.registerHook(transactionHookAdapter); List<TransactionHook> hooks = TransactionHookManager.getHooks(); assertThat(hooks).isNotEmpty(); assertThat(hooks.get(0)).isEqualTo(transactionHookAdapter); }
@Test public void testNPE() { Assertions.assertThrows(NullPointerException.class, () -> TransactionHookManager.registerHook(null)); }