Tengo la siguiente expresión:
scheduleIntervalContainers.stream()
.filter(sic -> ((ScheduleIntervalContainer) sic).getStartTime() != ((ScheduleIntervalContainer)sic).getEndTime())
.collect(Collectors.toList());
... donde scheduleIntervalContainerstiene el tipo de elemento ScheduleContainer:
final List<ScheduleContainer> scheduleIntervalContainers
¿Es posible comprobar el tipo antes del filtro?
.filter(ScheduleIntervalContainer.class::isInstance) .map(ScheduleIntervalContainer.class::cast)estilo que prefieras.