我使用max()在列表中找到最大值,但是下面的代码返回4,尽管最大值是90。List<Integer> list = new ArrayList<>(Arrays.asList(4,12,19,10,90,30,60,17,90));
System.out.println(list.stream().max(Integer::max).get());
我需要随机选择一个低于给定最大值的非素数,并返回它的所有因子。public Pair<Integer, Integer[]> getNonPrimeAndFactors(int maximum) //Randomly selecta non-prime less than maximum
return new Pair&