### Question:
ChangeSet { public boolean isCreationalFor(String path) { for (Change c : myChanges) { if (c.isCreationalFor(path)) return true; } return false; } ChangeSet(long id, long timestamp);  ChangeSet(DataInput in); void write(DataOutput out); void setName(@Nullable String name); @Nullable String getName(); long getTimestamp(); @Nullable String getLabel(); int getLabelColor(); void addChange(Change c); List<Change> getChanges(); boolean isEmpty(); boolean affectsPath(String paths); boolean isCreationalFor(String path); List<Content> getContentsToPurge(); boolean isContentChangeOnly(); boolean isLabelOnly(); Change getFirstChange(); Change getLastChange(); List<String> getAffectedPaths(); void accept(ChangeVisitor v); String toString(); long getId(); @Override final boolean equals(Object o); @Override final int hashCode();  }### Answer:
@Test public void testIsCreational() { ChangeSet cs1 = cs(new CreateFileChange(nextId(), "file")); ChangeSet cs2 = cs(new CreateDirectoryChange(nextId(), "dir")); assertTrue(cs1.isCreationalFor("file")); assertTrue(cs2.isCreationalFor("dir")); assertFalse(cs1.isCreationalFor("dir")); }
@Test public void testNonCreational() { ChangeSet cs = cs(new ContentChange(nextId(), "file", null, -1)); assertFalse(cs.isCreationalFor("file")); }
@Test public void testCreationalAndNonCreationalInOneChangeSet() { ChangeSet cs = cs(new CreateFileChange(nextId(), "file"), new ContentChange(nextId(), "file", null, -1)); assertTrue(cs.isCreationalFor("file")); }
@Test public void testToCreationalChangesInOneChangeSet() { ChangeSet cs = cs(new CreateFileChange(nextId(), "file"), new CreateDirectoryChange(nextId(), "dir")); assertTrue(cs.isCreationalFor("file")); assertTrue(cs.isCreationalFor("dir")); }