Representing binary relation in java
<p>One famous programmer said "why anybody need DB, just give me hash table!". I have list of grammar symbols together with their frequencies. One way it's a map: symbol#->frequency. The other way its a [binary] relation. Problem: get top 5 symbols by frequency. </p>

<p>More general question. I'm aware of [binary] relation algebra slowly making inroad into CS theory. Is there java library supporting relations? </p>
