protected static double toDouble(String s){
  try {
    return Double.parseDouble(s);
  }
 catch (  Exception e) {
    TestCase.fail("Failed to parse double: " + s + "\n"+ throwableToString(e));
    return Double.NaN;
  }
}

protected static double toDouble ( String s ) { try { return Double . parseDouble ( s ) ; } catch ( Exception e ) { TestCase . fail ( "Failed to parse double: " + s + "\n" + throwableToString ( e ) ) ; return Double . NaN ; } }
attempts to parse the string as double . in case this fails , testcase . fail ( ) is triggered .
