@Test
void openStreamWithDuplicateResources() {

    String path = "classpath-resource-test/resource.txt";
    URL resource = Thread.currentThread().getContextClassLoader().getResource(path);
    assertThatThrownBy(() -> ClasspathResources.openStream(List.of(resource, resource).iterator(), path))
            .isInstanceOf(Error.class)
            .hasMessageContaining("found duplicate resources with same name");
}