public boolean tryEnter(Object obj) {
    if (entered.containsKey(obj)) {
      return false;
    } else {
      entered.put(obj, null);
      return true;
    }
  }
public boolean tryEnter ( Object obj ) { if ( entered . containsKey ( obj ) ) { return false ; } else { entered . put ( obj , null ) ; return true ; } }
Queries whether invariants should be checked for the current
method call. If it returns {@code true}, {@link #leave(Object)}
must be called on method exit.

@return {@code true} if invariants should be evaluated,
{@code false} otherwise