void (String[] args) { final List<ConcreteId> list = new ArrayList<>(); final List<Long> longs = list.stream() .map(ConcreteId::getId) .collect(Collectors.toList()); final List<Long> longs2 = list.stream() .map(AbstractId::getId) .collect(Collectors.toList()); }