List of usage examples for java.util Spliterators emptySpliterator
@SuppressWarnings("unchecked") public static <T> Spliterator<T> emptySpliterator()
The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED .
From source file:org.cryptomator.cryptofs.CryptoDirectoryStreamTest.java
License:asdf
@Test(expected = NoSuchElementException.class) public void testDirListingForEmptyDir() throws IOException { Path cleartextPath = Paths.get("/foo/bar"); Mockito.when(dirStream.spliterator()).thenReturn(Spliterators.emptySpliterator()); try (CryptoDirectoryStream stream = new CryptoDirectoryStream(new Directory("foo", ciphertextDirPath), cleartextPath, filenameCryptor, cryptoPathMapper, longFileNameProvider, conflictResolver, ACCEPT_ALL, DO_NOTHING_ON_CLOSE, finallyUtil)) { Iterator<Path> iter = stream.iterator(); Assert.assertFalse(iter.hasNext()); iter.next();/*from w ww .j av a 2 s. c o m*/ } }