CloneDriveOptions { public CloneDriveOptions tags(String... tags) { String currentTagsString = options.remove("tags"); Set<String> currentTags = (currentTagsString == null) ? new HashSet<String>() : Sets.newLinkedHashSet(Splitter.on(' ').split(currentTagsString)); Set<String> newTags = Sets.newLinkedHashSet(); for (String tag : tags) newTags.add(tag); if (currentTags.contains(SSD_AFFINITY_TAG)) newTags.add(SSD_AFFINITY_TAG); options.put("tags", Joiner.on(' ').join(newTags)); return this; }  CloneDriveOptions size(long size); CloneDriveOptions tags(String... tags); CloneDriveOptions affinity(AffinityType affinity); Map<String, String> getOptions();  }
@Test public void testTags() { CloneDriveOptions options = new CloneDriveOptions().tags("foo", "bar", "baz"); assertEquals(options.getOptions().get("tags"), "foo bar baz"); }