public boolean check(final Direction dir,final boolean facing){
  if (this.dir != dir) {
    return false;
  }
  if (this.facing != facing) {
    return false;
  }
  final long now=System.currentTimeMillis();
  if (now >= expiration) {
    return false;
  }
  expiration=now + DELAY;
  return true;
}

public boolean check ( final Direction dir , final boolean facing ) { if ( this . dir != dir ) { return false ; } if ( this . facing != facing ) { return false ; } final long now = System . currentTimeMillis ( ) ; if ( now >= expiration ) { return false ; } expiration = now + DELAY ; return true ; }
check if a new direction matches the existing one , and if so , reset the expiration point .
