@Test public void collectReturnsCorrectPidEvenIfProcessCannotBeAccessed() { int pid = 4321; NativeProcess process = collector.collect(pid); assertEquals(pid, process.getPid()); }
@Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); @Override NativeProcess collect(int pid); }
LinuxNativeProcessCollector implements NativeProcessCollector { @Override public NativeProcess collect(int pid) { Path procPath = procRoot.resolve(Integer.toUnsignedString(pid)); NativeProcess process = readNativeProcess(procPath); process.setPid(pid); return process; } LinuxNativeProcessCollector(Path procRoot); @Override NativeProcess collect(int pid);  }