/**
  * Tests lock methods.
  *
  * @throws Exception to JUnit.
  */
 public void testLockMethods() throws Exception {
   URL file = new URL("http://localhost");
   Namespace ns = new Namespace("ns", file, "format", 5, null);
   assertTrue(ns.canLock("a"));
   ns.lock("a");
   assertFalse(ns.canLock("b"));
   assertTrue(ns.canLock("a"));
   ns.releaseLock();
   assertTrue(ns.canLock("a"));
   assertTrue(ns.canLock("b"));
 }