private static boolean compareDouble(final double d1,final double d2,final double diff){
  return Math.abs(d1 - d2) < diff;
}

private static boolean compareDouble ( final double d1 , final double d2 , final double diff ) { return Math . abs ( d1 - d2 ) < diff ; }
compares to floating point values .
