### Question:
SpiffeIdUtils { public static Set<SpiffeId> getSpiffeIdSetFromFile(final Path spiffeIdsFile) throws IOException { try (val lines = Files.lines(spiffeIdsFile)) { return lines .map(SpiffeId::parse) .collect(Collectors.toSet()); } } private  SpiffeIdUtils(); static Set<SpiffeId> getSpiffeIdSetFromFile(final Path spiffeIdsFile); static Set<SpiffeId> toSetOfSpiffeIds(final String spiffeIds, final char separator); static Set<SpiffeId> toSetOfSpiffeIds(final String spiffeIds);  }### Answer:
@Test void getSpiffeIdSetFromFile() throws URISyntaxException { Path path = Paths.get(toUri("testdata/spiffeid/spiffeIds.txt")); try { Set<SpiffeId> spiffeIdSet = SpiffeIdUtils.getSpiffeIdSetFromFile(path); assertNotNull(spiffeIdSet); assertEquals(3, spiffeIdSet.size()); assertTrue(spiffeIdSet.contains(SpiffeId.parse("spiffe: assertTrue(spiffeIdSet.contains(SpiffeId.parse("spiffe: assertTrue(spiffeIdSet.contains(SpiffeId.parse("spiffe: } catch (IOException e) { fail(e); } }
@Test void getSpiffeIdSetFromNonExistenFile_throwsException() throws IOException { Path path = Paths.get("testdata/spiffeid/non-existent-file"); try { SpiffeIdUtils.getSpiffeIdSetFromFile(path); fail("should have thrown exception"); } catch (NoSuchFileException e) { assertEquals("testdata/spiffeid/non-existent-file", e.getMessage()); } }