Here you can find the source of isIn20PercentRange(BigInteger first, BigInteger second)
public static boolean isIn20PercentRange(BigInteger first, BigInteger second)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { public static boolean isIn20PercentRange(BigInteger first, BigInteger second) {//from w w w. j a v a 2s .com BigInteger five = BigInteger.valueOf(5); BigInteger limit = first.add(first.divide(five)); return !isMoreThan(second, limit); } /** * @param valueA - not null * @param valueB - not null * @return true - if the valueA is more than valueB is zero */ public static boolean isMoreThan(BigInteger valueA, BigInteger valueB) { return valueA.compareTo(valueB) > 0; } }