@SuppressFBWarnings(value = "RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED")
  public int encode(CacheScope scopeInfo) {
    if (!mScopeToId.containsKey(scopeInfo)) {
      synchronized (this) {
        if (!mScopeToId.containsKey(scopeInfo)) {
          // NOTE: If update mScopeToId ahead of updating mIdToScope,
          // we may read a null scope info in decode.
          int id = mNextId;
          Preconditions.checkArgument(id < mMaxNumScopes, "too many scopes in shadow cache");
          mNextId++;
          mScopeToId.putIfAbsent(scopeInfo, id);
          // if we use mScopeToID.put() here,
          // we will get the findBug's error: the hashmap may not be atomic.
        }
      }
    }
    return mScopeToId.get(scopeInfo) & mScopeMask;
  }
@Test
  public void testBasic() {
    int id = mScopeEncoder.encode(SCOPE1);
    assertEquals(0, id);
  }