title: Find maximum value of an attribute in a array of objects
body: <p>In a Java program, I have a class WaterBody in which one of the attributes is a double for electric power output. How can I find the maximum electric power output value in an array of <code>WaterBody</code> instances?</p>
  
  <p>Here's my prototype:</p>
  
  <pre><code>public static WaterBody mostPowerful(WaterBody[] waterBodies) {
  
  }
  </code></pre>
  
  <p>Attribute is <code>electricPower</code> and I have the getter method <code>getElectricPower</code></p>
  
  <p>Thanks in advance.</p>