### Question:
LocalDirAllocator { @Deprecated @InterfaceAudience.LimitedPrivate({"MapReduce"}) public static void removeContext(String contextCfgItemName) { synchronized (contexts) { contexts.remove(contextCfgItemName); } } LocalDirAllocator(String contextCfgItemName); Path getLocalPathForWrite(String pathStr, 
      Configuration conf); Path getLocalPathForWrite(String pathStr, long size, 
      Configuration conf); Path getLocalPathForWrite(String pathStr, long size, 
                                   Configuration conf,
                                   boolean checkWrite); Path getLocalPathToRead(String pathStr, 
      Configuration conf); Iterable<Path> getAllLocalPathsToRead(String pathStr, 
                                               Configuration conf
                                               ); File createTmpFileForWrite(String pathStr, long size, 
      Configuration conf); static boolean isContextValid(String contextCfgItemName); @Deprecated @InterfaceAudience.LimitedPrivate({"MapReduce"}) static void removeContext(String contextCfgItemName); boolean ifExists(String pathStr,Configuration conf); static final int SIZE_UNKNOWN; }### Answer:
@Test public void testRemoveContext() throws IOException { String dir = buildBufferDir(ROOT, 0); try { String contextCfgItemName = "application_1340842292563_0004.app.cache.dirs"; conf.set(contextCfgItemName, dir); LocalDirAllocator localDirAllocator = new LocalDirAllocator( contextCfgItemName); localDirAllocator.getLocalPathForWrite("p1/x", SMALL_FILE_SIZE, conf); assertTrue(LocalDirAllocator.isContextValid(contextCfgItemName)); LocalDirAllocator.removeContext(contextCfgItemName); assertFalse(LocalDirAllocator.isContextValid(contextCfgItemName)); } finally { rmBufferDirs(); } }