I know it sounds dumb, but I really need it. I'm 100% positive about only allowing SubClass into the arraylist. No other subclass of SuperClass is in that arraylist.
How can I do this?
Map<String, List<Nodo>> map = ((Cast to ArrayList<NodoMoore> here)nodos).stream().
collect(Collectors.groupingBy(Nodo::getSalida));
My class implements an interface that makes me use Nodo instead of NodoMoore, but the getSalida method is not a Nodo method, only a NodoMoore method.