void () { ModifiableArtifactModel model = getArtifactManager().createModifiableModel(); model.addArtifact("a", PlainArtifactType.getInstance()); commitModel(model); Artifact artifact = ArtifactManager.getInstance(myProject).findArtifact("a"); ArtifactPointer pointer = getPointerManager().createPointer(artifact); assertSame(artifact, pointer.getArtifact()); assertSame(artifact, pointer.findArtifact(getArtifactManager())); ModifiableArtifactModel model2 = getArtifactManager().createModifiableModel(); model2.getOrCreateModifiableArtifact(artifact).setName("b"); assertEquals("b", pointer.getArtifactName(model2)); commitModel(model2); assertSame(pointer, getPointerManager().createPointer(artifact)); Map.Entry<String, ? extends ArtifactPointer> mapping = assertOneElement(getPointerManager().getResolvedPointers()); assertEquals("b", mapping.getKey()); assertEquals("b", artifact.getName()); assertSame(artifact, mapping.getValue().getArtifact()); assertSame(pointer, mapping.getValue()); assertSame(pointer, getPointerManager().createPointer("b")); final Artifact b = getArtifactManager().findArtifact("b"); assertNotNull(b); assertSame(b, pointer.getArtifact()); assertEquals("b", pointer.getArtifactName()); rename(b, "c"); assertSame(b, pointer.getArtifact()); assertEquals("c", pointer.getArtifactName()); }