Apache commons has this:
org.apache.commons.math3.util.Precision equals(double x, double y, double eps)
epsilon would be the distance you would allow. Looks like yours would be 1e-5?
The source-code of this method looks like it uses Math.abs as suggested in other answers.