@Override
    public Material toOldMaterial(String name, String folder, String password) {
        GitMaterial git = new GitMaterial(url, branch, folder);
        setName(name, git);
        git.setUserName(username);
        git.setPassword(password);
        git.setSubmoduleFolder(submoduleFolder);
        git.setId(id);
        return git;
    }
@Test
    void shouldCreateMaterialFromMaterialInstance() {
        final GitMaterialInstance materialInstance = new GitMaterialInstance("https://example.com", "bob",
                "feature", "submodule_folder", "some-flyweight");
        materialInstance.setId(100L);

        final GitMaterial material = (GitMaterial) materialInstance.toOldMaterial("example", "destination", "pass");

        assertThat(material.getName()).isEqualTo(new CaseInsensitiveString("example"));
        assertThat(material.getUrl()).isEqualTo("https://example.com");
        assertThat(material.getUserName()).isEqualTo("bob");
        assertThat(material.getPassword()).isEqualTo("pass");
        assertThat(material.getBranch()).isEqualTo("feature");
        assertThat(material.getSubmoduleFolder()).isEqualTo("submodule_folder");
        assertThat(material.getFolder()).isEqualTo("destination");
        assertThat(material.getId()).isEqualTo(materialInstance.getId());
    }