public synchronized List<K> keys(boolean cold,boolean nonResident){
  ArrayList<K> keys=new ArrayList<K>();
  for (  Segment<K,V> s : segments) {
    keys.addAll(s.keys(cold,nonResident));
  }
  return keys;
}

public synchronized List < K > keys ( boolean cold , boolean nonResident ) { ArrayList < K > keys = new ArrayList < K > ( ) ; for ( Segment < K , V > s : segments ) { keys . addAll ( s . keys ( cold , nonResident ) ) ; } return keys ; }
get the list of keys . this method allows to read the internal state of the cache .
