I have a hashmap and want to return the smallest key which value is 0
hashmap:
 10   1
 2    1
 3    1
 4    0
 8    0
it will return 4
while( map.containsValue(0))
{        
    int minValue=(Collections.min(map.keySet())); 
    if( map.containsKey(minValue))
    {
        System.out.println(minValue);
    }
    break;       
}
 
     
     
    