played around a bit with the Apache Commons Math library
refactored the example tests