protected InputStream getResourceAsStream(String resource) {
    return getClass().getResourceAsStream(resource);
  }
@DisplayName("Constructor should throw SecurityException for mismatched resource paths")
  @Test
  void constructor_WhenResourcePathsDoNotMatch_ShouldThrowSecurityException() {

    // Given
    class TestCountriesDataLoader extends DefaultCountriesDataLoaderImpl {
      @Override
      protected URL getResource(String resource) {
        try {
          if (resource.equals("/location4j.bin")) {
            return new URI("file:///mock-path/location4j.bin").toURL();
          } else if (resource.equals("TestCountriesDataLoader.class")) {
            return new URI("file:///hacked/DefaultCountriesDataLoaderImpl.class").toURL();
          }
        } catch (MalformedURLException | URISyntaxException e) {
          throw new RuntimeException("Failed to create mock URL for resource: " + resource, e);
        }
        return null;
      }

      @Override
      protected InputStream getResourceAsStream(String resource) {
        return this.getClass().getResourceAsStream("/hacked-location4j.bin");
      }
    }

    // When Then
    assertThatThrownBy(TestCountriesDataLoader::new)
        .isInstanceOf(SecurityException.class)
        .hasMessageContaining("/location4j.bin is not in the same artifact as the loader: security issue");
  }