@Test public void getsCorrectPids() { List<Integer> expectedPids = Arrays.asList(0, 1, 23, 502, 5992, 120, 235, 599, 4003); pidEnumerator = () -> new ArrayList<>(expectedPids); List<NativeProcess> processes = enumerator.getProcesses(); List<Integer> pids = processes.stream().map(NativeProcess::getPid).collect(Collectors.toList()); assertTrue(expectedPids.containsAll(pids)); assertTrue(pids.containsAll(expectedPids)); }
@Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); }
NativeProcessEnumeratorImpl implements NativeProcessEnumerator { @Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); } }
NativeProcessEnumeratorImpl implements NativeProcessEnumerator { @Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); } NativeProcessEnumeratorImpl(PidEnumerator pidEnumerator,
                                       NativeProcessCollector processCollector); }
NativeProcessEnumeratorImpl implements NativeProcessEnumerator { @Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); } NativeProcessEnumeratorImpl(PidEnumerator pidEnumerator,
                                       NativeProcessCollector processCollector); @Override List<NativeProcess> getProcesses(); }
NativeProcessEnumeratorImpl implements NativeProcessEnumerator { @Override public List<NativeProcess> getProcesses() { return pidEnumerator .getPids() .stream() .map(processCollector::collect) .collect(Collectors.toList()); } NativeProcessEnumeratorImpl(PidEnumerator pidEnumerator,
                                       NativeProcessCollector processCollector); @Override List<NativeProcess> getProcesses();  }