Validate variable is in range Java
<p>I have three integers, which are assigned to variables after being passed in as command line parameters. I want to validate that each of the integers are in the range 1-5. Is there a way to accomplish this in Java without using an if statement like the one below? I'd like to avoid doing this (note- pseudocode): </p>

<pre><code>if ((a &amp; b &amp; c) &gt; 0 &amp;&amp; (a &amp; b &amp; c) &lt; 6) {
//blah blah
}
</code></pre>

<p>Mainly, this wouldn't scale well if additional parameters were added in the future, etc. Is there a more elegant way to accomplish this?</p>
