@Test public void alreadyLocked() throws LackException { cachedLack.acquire(resource); thrown.expect(LackException.class); cachedLack.acquire(resource); }
@Override public void acquire(String resource) throws LackException { Boolean locked = cache.getIfPresent(resource); if (locked != null && locked) { throw new LackException(String.format(MESSAGE_ACQUIRE, resource)); } super.acquire(resource); cache.put(resource, true); }
CachedLack extends Lack { @Override public void acquire(String resource) throws LackException { Boolean locked = cache.getIfPresent(resource); if (locked != null && locked) { throw new LackException(String.format(MESSAGE_ACQUIRE, resource)); } super.acquire(resource); cache.put(resource, true); } }
CachedLack extends Lack { @Override public void acquire(String resource) throws LackException { Boolean locked = cache.getIfPresent(resource); if (locked != null && locked) { throw new LackException(String.format(MESSAGE_ACQUIRE, resource)); } super.acquire(resource); cache.put(resource, true); } CachedLack(LackConfig config, String owner, Cache<String, Boolean> cache);  CachedLack(LackConfig config, String owner, long size); }
CachedLack extends Lack { @Override public void acquire(String resource) throws LackException { Boolean locked = cache.getIfPresent(resource); if (locked != null && locked) { throw new LackException(String.format(MESSAGE_ACQUIRE, resource)); } super.acquire(resource); cache.put(resource, true); } CachedLack(LackConfig config, String owner, Cache<String, Boolean> cache);  CachedLack(LackConfig config, String owner, long size); @Override void acquire(String resource); @Override void renew(String resource); @Override void release(String resource); }
CachedLack extends Lack { @Override public void acquire(String resource) throws LackException { Boolean locked = cache.getIfPresent(resource); if (locked != null && locked) { throw new LackException(String.format(MESSAGE_ACQUIRE, resource)); } super.acquire(resource); cache.put(resource, true); } CachedLack(LackConfig config, String owner, Cache<String, Boolean> cache);  CachedLack(LackConfig config, String owner, long size); @Override void acquire(String resource); @Override void renew(String resource); @Override void release(String resource);  }