VirtualFileSystem { private String[] tokenize(String path){ return tokenize(path,File.separatorChar); } private  VirtualFileSystem(); static VirtualFileSystem getInstance(); void resetSingleton(); void addLeakingResource(LeakingResource resource); File getRealTmpFile(); void throwSimuledIOExceptionIfNeeded(String path); boolean isClassSupposedToThrowIOException(String path); boolean setShouldThrowIOException(EvoSuiteFile file); boolean setShouldAllThrowIOExceptions(); void init(); static String getWorkingDirPath(); static String getDefaultParent(); Set<String> getAccessedFiles(); String createTempFile(String prefix, String suffix, File directory); boolean exists(String rawPath); FSObject findFSObject(String rawPath); boolean deleteFSObject(String rawPath); boolean createFile(String rawPath); boolean rename(String source, String destination); boolean createFolder(String rawPath);  }
@Test public void testTokenizeOnWindows(){ String[] paths = new String[]{ "C:\\foo\\single", "C:\\\\foo\\\\double", "C:\\foo\\\\mixed", "D:\\foo\\onD", "D:\\foo\\trail\\", "D:\\foo\\doubleTrail\\\\", "D:\\\\\\\\foo\\eight" }; for(String path : paths){ String[] tokens = VirtualFileSystem.tokenize(path, '\\'); Assert.assertEquals(Arrays.toString(tokens),3, tokens.length); for(String token : tokens){ Assert.assertFalse(token, token.contains("\\")); } } }