I'm struggling to understand how can I make the following code work.
The field count_human_dna of my stat class is of type BigDecimal, with setting the type as Long this works, but I need to change it to BigDecimal, can somehow tell me how could I make this work for BigDecimal field?
stat.setCount_human_dna(dnaSamples.stream()
.filter(x -> x.getType().equals("Human"))
.collect(Collectors.counting()));
This code is counting all the dnaSamples which type belong to Human.