battery estimator in java