job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/JobsService.java
public Observable<JobDetails> findScheduledJobs(Date timeSlice, rx.Scheduler scheduler) {
        return session.executeAndFetch(findAllScheduled.bind(), scheduler)
                .filter(filterNullJobs)
                .filter(row -> row.getTimestamp(0).compareTo(timeSlice) <= 0)
                .map(row -> createJobDetails(
                        row.getUUID(1),
                        row.getString(2),
                        row.getString(3),
                        row.getMap(4, String.class, String.class),
                        getTrigger(row.getUDTValue(5)),
                        JobStatus.fromCode(row.getByte(6)),
                        timeSlice))
                .collect(HashMap::new, (Map<UUID, SortedSet<JobDetails>> map, JobDetails details) -> {
                    SortedSet<JobDetails> set = map.get(details.getJobId());
                    if (set == null) {
                        set = new TreeSet<>((JobDetails d1, JobDetails d2) ->
                                Long.compare(d1.getTrigger().getTriggerTime(), d2.getTrigger().getTriggerTime()));
                    }
                    set.add(details);
                    map.put(details.getJobId(), set);
                })
                .flatMap(map -> Observable.from(map.entrySet()))
                .map(entry -> entry.getValue().first());
    }
public Observable<JobDetails> findScheduledJobs(Date timeSlice, rx.Scheduler scheduler) {
        return session.executeAndFetch(findAllScheduled.bind(), scheduler)
                .filter(filterNullJobs)
                .filter(row -> row.getTimestamp(0).compareTo(timeSlice) <= 0)
                .map(row -> createJobDetails(
                        row.getUUID(1),
                        row.getString(2),
                        row.getString(3),
                        row.getMap(4, String.class, String.class),
                        getTrigger(row.getUDTValue(5)),
                        JobStatus.fromCode(row.getByte(6)),
                        timeSlice))
                .collect(HashMap::new, (Map<UUID, SortedSet<JobDetails>> map, JobDetails details) -> {
                    SortedSet<JobDetails> set = map.get(details.getJobId());
                    if (set == null) {
                        set = new TreeSet<>((JobDetails d1, JobDetails d2) ->
                                Long.compare(d1.getTrigger().getTriggerTime(), d2.getTrigger().getTriggerTime()));
                    }
                    set.add(details);
                    map.put(details.getJobId(), set);
                })
                .flatMap(map -> Observable.from(map.entrySet()))
                .map(entry -> entry.getValue().first());
    }
This method is currently unused.