PyRemotePathMapper extends AbstractPathMapper implements Cloneable { @NotNull public static PyRemotePathMapper fromSettings(@NotNull PathMappingSettings settings, @NotNull PyPathMappingType mappingType) { PyRemotePathMapper mapper = new PyRemotePathMapper(); mapper.addAll(settings.getPathMappings(), mappingType); return mapper; }  @NotNull static PyRemotePathMapper fromSettings(@NotNull PathMappingSettings settings, @NotNull PyPathMappingType mappingType); void addMapping(String local, String remote, @NotNull PyPathMappingType type); @Override boolean isEmpty(); @NotNull @Override String convertToLocal(@NotNull String remotePath); @NotNull @Override String convertToRemote(@NotNull String localPath); void addAll(@NotNull Collection<PathMappingSettings.PathMapping> mappings, @NotNull PyPathMappingType type); @NotNull static PyRemotePathMapper cloneMapper(@Nullable PyRemotePathMapper mapper); @Override PyRemotePathMapper clone();  }
@Test public void testFromSettings() throws Exception { PathMappingSettings settings = new PathMappingSettings(); PyRemotePathMapper emptyMapper = PyRemotePathMapper.fromSettings(settings, PyPathMappingType.USER_DEFINED); assertTrue(emptyMapper.isEmpty()); settings.add(new PathMappingSettings.PathMapping("C:\\local\\folder", "/remote/folder")); settings.add(new PathMappingSettings.PathMapping("C:\\local\\folder\\child", "/remote/child-from-local")); settings.add(new PathMappingSettings.PathMapping("C:\\local\\child-from-remote", "/remote/folder/child")); PyRemotePathMapper mapper = PyRemotePathMapper.fromSettings(settings, PyPathMappingType.HELPERS); assertFalse(mapper.isEmpty()); assertConvertsOneToAnother(mapper, "C:\\local\\folder\\src\\main.py", "/remote/folder/src/main.py"); assertConvertsOneToAnother(mapper, "C:\\local\\folder\\child\\test\\all.py", "/remote/child-from-local/test/all.py"); assertConvertsOneToAnother(mapper, "C:/local/child-from-remote/README", "/remote/folder/child/README"); assertEquals("/unmapped/list.txt", mapper.convertToLocal("/unmapped/list.txt")); assertEquals("C:\\unmapped\\list.txt", mapper.convertToRemote("C:\\unmapped\\list.txt")); }