public void filterValues(Predicate<Value> predicate){
  Stack<String> toRemove=new Stack<String>();
  for (  String var : map.keySet()) {
    if (!predicate.test(map.get(var))) {
      toRemove.add(var);
    }
  }
  while (!toRemove.isEmpty()) {
    map.remove(toRemove.pop());
  }
  cachedHash=0;
}

public void filterValues ( Predicate < Value > predicate ) { Stack < String > toRemove = new Stack < String > ( ) ; for ( String var : map . keySet ( ) ) { if ( ! predicate . test ( map . get ( var ) ) ) { toRemove . add ( var ) ; } } while ( ! toRemove . isEmpty ( ) ) { map . remove ( toRemove . pop ( ) ) ; } cachedHash = 0 ; }
filter the assignment by removing all pairs that do not satisfy the given predicate
