List<String> data = Arrays.asList("a", "d", "a", "d", "a", "b", "a", "c", "d", "b", "c", "c", "d", "d");
Map<String, Long> freq = data.stream()
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
List<String> results = freq.entrySet().stream().sorted(Map.Entry.comparingByValue()).map(Map.Entry::getKey)
.collect(Collectors.toList());
System.err.println(results);
String result = results.get(results.size() - 1);
assertThat(result, is("d"));
Running example.BasicTest
[b, c, a, d]
H=(01 02 03 04 05 06 07 08 09 10 11)
for i in ${H[@]}; do echo ${H[${i#0}]} ;done
02
03
04
05
06
07
08
09
10
11
for J in ${H[@]}; do echo $J ;done
for (( i=0; i<${#H[@]}; i++ )); do echo ${H[${i}]}; done
for (( i=0; i<${#H[@]}; i++ )); do echo ${H[i]}; done
docker network ls
покажите свой