title: How to overcome the fact that primitives are passed by value
body: <p>I have a long piece of code that calculates two values (<code>doubles</code>) for me, I use this piece of code in a few places - to stick with DRY principles I should refactor this bit of code to a nice unit testable method. However I cant make it return two doubles, and doubles are primitive so cannot be passed by value and manipulated. The cleanest way I can think of doing this is by making this method return an <code>double[]</code>. Can anyone think of a better way?</p>
  
  <p>Thanks</p>