@VisibleForTesting
  static Optional<AbsoluteUnixPath> getWorkingDirectoryChecked(RawConfiguration rawConfiguration)
      throws InvalidWorkingDirectoryException {
    Optional<String> directory = rawConfiguration.getWorkingDirectory();
    if (!directory.isPresent()) {
      return Optional.empty();
    }

    String path = directory.get();
    try {
      return Optional.of(AbsoluteUnixPath.get(path));
    } catch (IllegalArgumentException ex) {
      throw new InvalidWorkingDirectoryException(path, path, ex);
    }
  }
@Test
  public void testGetWorkingDirectoryChecked_notAbsolute() {
    when(rawConfiguration.getWorkingDirectory()).thenReturn(Optional.of("relative/path"));

    InvalidWorkingDirectoryException exception =
        assertThrows(
            InvalidWorkingDirectoryException.class,
            () -> PluginConfigurationProcessor.getWorkingDirectoryChecked(rawConfiguration));
    assertThat(exception).hasMessageThat().isEqualTo("relative/path");
    assertThat(exception.getInvalidPathValue()).isEqualTo("relative/path");
  }