title: What is the easiest way to fetch the entity value in java giving other attributes
body: <p>What would be the easiest way to fetch the value given from, to as arguments. Should I iterate and find or is there a more elegant way?</p>
  <pre><code>FOO.java (from, to, value)
  
  public static FOO ONE = new FOO(6000000, 7000000, &quot;60 - 70&quot;);
  public static FOO TWO = new FOO(7000000, 8000000, &quot;70 - 80&quot;);
  public static FOO THREE = new FOO(8000000, 9000000, &quot;80 - 90&quot;);
  
  private static List&lt;FOO&gt; VALID_FOOS = new ArrayList&lt;FOO&gt;();
  VALID_FOOS.add(ONE);
  VALID_FOOS.add(TWO);
  VALID_FOOS.add(THREE);
  </code></pre>