synchronized Set<Long> keySet(){
  HashSet<Long> set=new HashSet<Long>();
  for (Entry<V> e=stack.stackNext; e != stack; e=e.stackNext) {
    set.add(e.key);
  }
  for (Entry<V> e=queue.queueNext; e != queue; e=e.queueNext) {
    set.add(e.key);
  }
  return set;
}

synchronized Set < Long > keySet ( ) { HashSet < Long > set = new HashSet < Long > ( ) ; for ( Entry < V > e = stack . stackNext ; e != stack ; e = e . stackNext ) { set . add ( e . key ) ; } for ( Entry < V > e = queue . queueNext ; e != queue ; e = e . queueNext ) { set . add ( e . key ) ; } return set ; }
get the set of keys for resident entries .
