@Test
  public void missingFileInFullDirectoryThrowsFileNotFoundException() throws Exception {
    // arrange
    int[] pids = new AvailablePid().findAvailablePids(4);
    for (int i = 1; i <= pids.length; i++) {
      FileUtils.writeStringToFile(
          new File(directory, "pid" + i + ".txt"), String.valueOf(pids[i - 1]),
          Charset.defaultCharset());
    }
    assertThat(directory.listFiles()).hasSameSizeAs(pids);

    // act/assert
    assertThatThrownBy(() -> new PidFile(directory, pidFileName).readPid())
        .isInstanceOf(FileNotFoundException.class).hasMessage(
            "Unable to find PID file '" + pidFileName + "' in directory '" + directory + "'");
  }
Functional integration tests for {@link PidFile}.

@since GemFire 8.2
geode-core/src/integrationTest/java/org/apache/geode/internal/process/PidFileIntegrationTest.java