### Question:
ProcessInfo { public String getBaseName() { if (baseName == null) { baseName = (getName() != null) ? new File(getName()).getName() : UNKNOWN_PROCESS_NAME; } return baseName; } protected  ProcessInfo();  ProcessInfo(long pid);  ProcessInfo(long pid, SigarProxy sigar); void refresh(); ProcessInfoSnapshot priorSnaphot(); ProcessInfoSnapshot freshSnapshot(); void destroy(); long getPid(); String getName(); String getBaseName(); String[] getCommandLine(); Map<String, String> getEnvironmentVariables(); @Nullable String getEnvironmentVariable(@NotNull
    String name); @Deprecated long getParentPid(); @Deprecated ProcState getState(); @Deprecated ProcExe getExecutable(); @Deprecated ProcTime getTime(); @Deprecated ProcMem getMemory(); @Deprecated ProcCpu getCpu(); @Deprecated ProcFd getFileDescriptor(); @Deprecated ProcCred getCredentials(); @Deprecated ProcCredName getCredentialsName(); @Deprecated String getCurrentWorkingDirectory(); @Deprecated boolean isRunning(); AggregateProcessInfo getAggregateProcessTree(); ProcessInfo getParentProcess(); void kill(String signalName); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testGetBaseName() throws Exception { File tmpFile = File.createTempFile("ProcessInfoTest-", ".tmp"); tmpFile.deleteOnExit(); procState = Mockito.mock(ProcState.class); when(procState.getName()).thenReturn(tmpFile.getAbsolutePath()); when(sigarProxy.getProcState(PID)).thenReturn(procState); processInfo = new ProcessInfo(PID, sigarProxy); assertEquals(processInfo.getBaseName(), tmpFile.getName()); }