### Question:
RootContext { public static BranchType getBranchType() { if (inGlobalTransaction()) { BranchType branchType = (BranchType) CONTEXT_HOLDER.get(KEY_BRANCH_TYPE); if (branchType != null) { return branchType; } return DEFAULT_BRANCH_TYPE; } return null; } private  RootContext(); static void setDefaultBranchType(BranchType defaultBranchType); static String getXID(); static void bind(@Nonnull String xid); static void bindGlobalLockFlag(); static String unbind(); static void unbindGlobalLockFlag(); static boolean inGlobalTransaction(); static boolean inTccBranch(); static boolean inSagaBranch(); static BranchType getBranchType(); static void bindBranchType(@Nonnull BranchType branchType); static BranchType unbindBranchType(); static boolean requireGlobalLock(); static void assertNotInGlobalTransaction(); static Map<String, Object> entries(); static final String KEY_XID; static final String KEY_BRANCH_TYPE; static final String KEY_GLOBAL_LOCK_FLAG; static final Boolean VALUE_GLOBAL_LOCK_FLAG; }### Answer:
@Test public void testGetBranchType() { RootContext.bindBranchType(DEFAULT_BRANCH_TYPE); assertThat(RootContext.getBranchType()).isNull(); RootContext.bind(DEFAULT_XID); assertThat(RootContext.getBranchType()).isEqualTo(DEFAULT_BRANCH_TYPE); RootContext.unbind(); assertThat(RootContext.unbindBranchType()).isEqualTo(DEFAULT_BRANCH_TYPE); assertThat(RootContext.getBranchType()).isNull(); }