This is just a very simple implementation that retrieves information whose number is not in the range:
List<Integer> notInRangeNumbers = new ArrayList<Integer>(); for (Integer number : numbers) { if (!isInRange(number)) {
Also, inside the isInRange
method isInRange
you must determine what you mean by “good values” . Below you will find an example implementation.
private boolean isInRange(Integer number, int aroundFactor) {
source share