List of usage examples for org.apache.commons.collections.bag TreeBag add
public boolean add(Object object, int nCopies)
From source file:org.sonar.api.utils.DeprecatedKeyValueFormatTest.java
@Test public void formatBag() { TreeBag bag = new TreeBag(); bag.add("hello", 1); bag.add("key", 3); assertThat(KeyValueFormat.format(bag), is("hello=1;key=3")); }
From source file:org.sonar.api.utils.DeprecatedKeyValueFormatTest.java
@Test public void formatBagWithVariationHack() { TreeBag bag = new TreeBag(); bag.add("hello", 1); bag.add("key", 3); assertThat(KeyValueFormat.format(bag, -1), is("hello=0;key=2")); }
From source file:org.sonar.api.utils.KeyValueFormatTest.java
@Test public void formatBag() { TreeBag bag = new TreeBag(); bag.add("hello", 1); bag.add("key", 3); assertThat(KeyValueFormat.format(bag, 0)).isEqualTo("hello=1;key=3"); }
From source file:org.sonar.api.utils.KeyValueFormatTest.java
@Test public void formatBagWithVariationHack() { TreeBag bag = new TreeBag(); bag.add("hello", 1); bag.add("key", 3); assertThat(KeyValueFormat.format(bag, -1)).isEqualTo("hello=0;key=2"); }