mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Addressing code review comments
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/classified_renditions@111703 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.FPUtils.asListFrom;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.FPUtils.asSet;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.FPUtils.asSetFrom;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.emptyList;
|
||||
@@ -57,10 +58,20 @@ public class FPUtilsUnitTest
|
||||
|
||||
@Test public void asSetShouldProduceSet()
|
||||
{
|
||||
Set<String> expectedSet = new HashSet<>();
|
||||
expectedSet.add("hello");
|
||||
expectedSet.add("world");
|
||||
assertEquals(new HashSet<>(asList("hello", "world")),
|
||||
asSet("hello", "hello", "world"));
|
||||
}
|
||||
|
||||
assertEquals(expectedSet, asSet("hello", "hello", "world"));
|
||||
@Test public void asSetFromShouldWork()
|
||||
{
|
||||
Set<String> s = asSetFrom(() -> "hello",
|
||||
() -> "hello",
|
||||
() -> "world",
|
||||
() -> {
|
||||
String s1 = "wo";
|
||||
String s2 = "rld";
|
||||
return s1 + s2;
|
||||
});
|
||||
assertEquals(new HashSet<>(asList("hello", "world")), s);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user