Remove trailing white spaces on all lines.

This commit is contained in:
Gary Gregory 2018-06-12 15:32:24 -06:00
parent bbf6533902
commit 56706c8203
2 changed files with 85 additions and 85 deletions

View File

@ -55,7 +55,7 @@ public class MultiSetUtilsTest {
} catch (UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
} }
} }
/** /**
* Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}. * Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}.
*/ */
@ -63,30 +63,30 @@ public class MultiSetUtilsTest {
public void testUnmodifiableMultiSet() { public void testUnmodifiableMultiSet() {
MultiSet<String> unmodifiable = MultiSetUtils.unmodifiableMultiSet(multiSet); MultiSet<String> unmodifiable = MultiSetUtils.unmodifiableMultiSet(multiSet);
assertEquals(multiSet, unmodifiable); assertEquals(multiSet, unmodifiable);
try { try {
unmodifiable.add("a"); unmodifiable.add("a");
fail("Empty multi set must be read-only"); fail("Empty multi set must be read-only");
} catch (UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
} }
try { try {
MultiSetUtils.unmodifiableMultiSet(null); MultiSetUtils.unmodifiableMultiSet(null);
fail("Expecting NPE"); fail("Expecting NPE");
} catch (NullPointerException e) { } catch (NullPointerException e) {
} }
} }
/** /**
* Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}. * Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}.
*/ */
@Test @Test
public void testSynchronizedMultiSet() { public void testSynchronizedMultiSet() {
MultiSet<String> synced = MultiSetUtils.synchronizedMultiSet(multiSet); MultiSet<String> synced = MultiSetUtils.synchronizedMultiSet(multiSet);
assertEquals(multiSet, synced); assertEquals(multiSet, synced);
synced.add("a"); // ensure adding works synced.add("a"); // ensure adding works
} }
/** /**
* Tests {@link MultiSetUtils#predicatedMultiSet(org.apache.commons.collections4.MultiSet, org.apache.commons.collections4.Predicate)}. * Tests {@link MultiSetUtils#predicatedMultiSet(org.apache.commons.collections4.MultiSet, org.apache.commons.collections4.Predicate)}.
*/ */
@ -101,13 +101,13 @@ public class MultiSetUtilsTest {
MultiSet<String> predicated = MultiSetUtils.predicatedMultiSet(multiSet, predicate); MultiSet<String> predicated = MultiSetUtils.predicatedMultiSet(multiSet, predicate);
assertEquals(multiSet.size(), predicated.size()); assertEquals(multiSet.size(), predicated.size());
assertEquals(multiSet.getCount("a"), predicated.getCount("a")); assertEquals(multiSet.getCount("a"), predicated.getCount("a"));
try { try {
MultiSetUtils.predicatedMultiSet(null, predicate); MultiSetUtils.predicatedMultiSet(null, predicate);
fail("Expecting NPE"); fail("Expecting NPE");
} catch (NullPointerException e) { } catch (NullPointerException e) {
} }
try { try {
MultiSetUtils.predicatedMultiSet(multiSet, null); MultiSetUtils.predicatedMultiSet(multiSet, null);
fail("Expecting NPE"); fail("Expecting NPE");

View File

@ -451,7 +451,7 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
// object is not existing // object is not existing
Object obj = m.remove(44); Object obj = m.remove(44);
assertNull(obj); assertNull(obj);
m.put(ONE, ONE); m.put(ONE, ONE);
obj = m.remove(ONE); obj = m.remove(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
@ -460,31 +460,31 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
// after removal, be no longer there // after removal, be no longer there
obj = m.get(ONE); obj = m.get(ONE);
assertNull(obj); assertNull(obj);
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(ONE); obj = m.remove(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertNull(obj); assertNull(obj);
obj = m.get(TWO); obj = m.get(TWO);
assertSame(TWO, obj); assertSame(TWO, obj);
} }
public void testRemove2() { public void testRemove2() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(ONE); obj = m.remove(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertNull(obj); assertNull(obj);
obj = m.get(TWO); obj = m.get(TWO);
@ -492,18 +492,18 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
obj = m.get(THREE); obj = m.get(THREE);
assertSame(THREE, obj); assertSame(THREE, obj);
} }
public void testRemove3() { public void testRemove3() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(TWO); obj = m.remove(TWO);
assertSame(TWO, obj); assertSame(TWO, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(TWO); obj = m.get(TWO);
@ -511,18 +511,18 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
obj = m.get(THREE); obj = m.get(THREE);
assertSame(THREE, obj); assertSame(THREE, obj);
} }
public void testRemove4() { public void testRemove4() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(THREE); obj = m.remove(THREE);
assertSame(THREE, obj); assertSame(THREE, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(TWO); obj = m.get(TWO);
@ -530,63 +530,63 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
obj = m.get(THREE); obj = m.get(THREE);
assertNull(obj); assertNull(obj);
} }
public void testRemove5() { public void testRemove5() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(null, ONE); m.put(null, ONE);
obj = m.remove(null); obj = m.remove(null);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(null); obj = m.get(null);
assertNull(obj); assertNull(obj);
} }
public void testRemove6() { public void testRemove6() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(null, TWO); m.put(null, TWO);
obj = m.remove(null); obj = m.remove(null);
assertSame(TWO, obj); assertSame(TWO, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(null); obj = m.get(null);
assertNull(obj); assertNull(obj);
} }
public void testRemove7() { public void testRemove7() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(null, ONE); m.put(null, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
obj = m.remove(null); obj = m.remove(null);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(null); obj = m.get(null);
assertNull(obj); assertNull(obj);
obj = m.get(TWO); obj = m.get(TWO);
assertSame(TWO, obj); assertSame(TWO, obj);
} }
public void testRemove8() { public void testRemove8() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(null, THREE); m.put(null, THREE);
obj = m.remove(null); obj = m.remove(null);
assertSame(THREE, obj); assertSame(THREE, obj);
obj = m.get(ONE); obj = m.get(ONE);
assertSame(ONE, obj); assertSame(ONE, obj);
obj = m.get(TWO); obj = m.get(TWO);
@ -598,20 +598,20 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
public void testRemove9() { public void testRemove9() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
obj = m.remove(null); obj = m.remove(null);
assertNull(obj); assertNull(obj);
} }
public void testRemove10() { public void testRemove10() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
obj = m.remove(null); obj = m.remove(null);
assertNull(obj); assertNull(obj);
} }
@ -619,82 +619,82 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
public void testRemove11() { public void testRemove11() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(null); obj = m.remove(null);
assertNull(obj); assertNull(obj);
} }
public void testRemove12() { public void testRemove12() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
obj = m.remove(42); obj = m.remove(42);
assertNull(obj); assertNull(obj);
} }
public void testRemove13() { public void testRemove13() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
obj = m.remove(42); obj = m.remove(42);
assertNull(obj); assertNull(obj);
} }
public void testNewInstance1() { public void testNewInstance1() {
final Map<Integer, Integer> orig = new HashMap<>(); final Map<Integer, Integer> orig = new HashMap<>();
orig.put(ONE, ONE); orig.put(ONE, ONE);
orig.put(TWO, TWO); orig.put(TWO, TWO);
final Flat3Map<Integer, Integer> m = new Flat3Map<>(orig); final Flat3Map<Integer, Integer> m = new Flat3Map<>(orig);
assertEquals(orig, m); assertEquals(orig, m);
assertEquals(2, m.size()); assertEquals(2, m.size());
} }
public void testGet1() { public void testGet1() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(null, ONE); m.put(null, ONE);
obj = m.get(null); obj = m.get(null);
assertSame(ONE, obj); assertSame(ONE, obj);
} }
public void testGet2() { public void testGet2() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(null, TWO); m.put(null, TWO);
obj = m.get(null); obj = m.get(null);
assertSame(TWO, obj); assertSame(TWO, obj);
} }
public void testGet3() { public void testGet3() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
Object obj; Object obj;
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(null, THREE); m.put(null, THREE);
obj = m.get(null); obj = m.get(null);
assertSame(THREE, obj); assertSame(THREE, obj);
} }
public void testContainsKey1() { public void testContainsKey1() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(null, THREE); m.put(null, THREE);
@ -704,24 +704,24 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
public void testContainsKey2() { public void testContainsKey2() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(null, TWO); m.put(null, TWO);
boolean contains = m.containsKey(null); boolean contains = m.containsKey(null);
assertEquals(true, contains); assertEquals(true, contains);
} }
public void testContainsKey3() { public void testContainsKey3() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(null, ONE); m.put(null, ONE);
boolean contains = m.containsKey(null); boolean contains = m.containsKey(null);
assertEquals(true, contains); assertEquals(true, contains);
} }
public void testContainsValue1() { public void testContainsValue1() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, null); m.put(THREE, null);
@ -731,24 +731,24 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
public void testContainsValue2() { public void testContainsValue2() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, null); m.put(TWO, null);
boolean contains = m.containsValue(null); boolean contains = m.containsValue(null);
assertEquals(true, contains); assertEquals(true, contains);
} }
public void testContainsValue3() { public void testContainsValue3() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, null); m.put(ONE, null);
boolean contains = m.containsValue(null); boolean contains = m.containsValue(null);
assertEquals(true, contains); assertEquals(true, contains);
} }
public void testPut1() { public void testPut1() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(null, THREE); m.put(null, THREE);
@ -756,29 +756,29 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
assertEquals(THREE, old); assertEquals(THREE, old);
assertEquals(ONE, m.get(null)); assertEquals(ONE, m.get(null));
} }
public void testPut2() { public void testPut2() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(null, THREE); m.put(null, THREE);
Object old = m.put(null, ONE); Object old = m.put(null, ONE);
assertEquals(THREE, old); assertEquals(THREE, old);
assertEquals(ONE, m.get(null)); assertEquals(ONE, m.get(null));
} }
public void testPut3() { public void testPut3() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(null, THREE); m.put(null, THREE);
Object old = m.put(null, ONE); Object old = m.put(null, ONE);
assertEquals(THREE, old); assertEquals(THREE, old);
assertEquals(null, m.get(ONE)); assertEquals(null, m.get(ONE));
} }
public void testPut4() { public void testPut4() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, TWO); m.put(TWO, TWO);
m.put(THREE, THREE); m.put(THREE, THREE);
@ -786,20 +786,20 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
assertEquals(THREE, old); assertEquals(THREE, old);
assertEquals(ONE, m.get(THREE)); assertEquals(ONE, m.get(THREE));
} }
public void testPut5() { public void testPut5() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, ONE); m.put(ONE, ONE);
m.put(TWO, THREE); m.put(TWO, THREE);
Object old = m.put(TWO, ONE); Object old = m.put(TWO, ONE);
assertEquals(THREE, old); assertEquals(THREE, old);
assertEquals(ONE, m.get(TWO)); assertEquals(ONE, m.get(TWO));
} }
public void testPut6() { public void testPut6() {
final Flat3Map<Integer, Integer> m = new Flat3Map<>(); final Flat3Map<Integer, Integer> m = new Flat3Map<>();
m.put(ONE, THREE); m.put(ONE, THREE);
Object old = m.put(ONE, ONE); Object old = m.put(ONE, ONE);
assertEquals(THREE, old); assertEquals(THREE, old);