private static final double RESULT_OF_DIVISION_BY_0 = 9.99;
public static double getPercentageDifference(long currentResult, long previousResult) {
if (previousResult == 0 && currentResult == 0) {
return 0;
} else if (previousResult == 0) {
return RESULT_OF_DIVISION_BY_0;
} else {
return (currentResult - previousResult) * 1.0 / previousResult;
}
}