AttachProcessUtils implements InternalProcessUtils { @Override public boolean isProcessAlive(final int pid) { isTrue(pid > 0, "Invalid pid '" + pid + "' specified"); for (VirtualMachineDescriptor vm : VirtualMachine.list()) { if (vm.id().equals(String.valueOf(pid))) { return true; } } return false; }  @Override boolean isProcessAlive(final int pid); @Override boolean killProcess(final int pid); @Override boolean isAvailable(); @Override boolean isAttachApiAvailable();  }
@Test public void isProcessAlive_withLivePid_returnsTrue() throws Exception { assertThat(attachProcessUtils.isProcessAlive(actualPid)).isTrue(); }
@Test @Retry(3) public void isProcessAlive_withDeadPid_returnsFalse() throws Exception { assertThat(attachProcessUtils.isProcessAlive(fakePid)).isFalse(); }