java.util.Collectionscom.google.common.collect.ImmutableSet



Project jclouds/jclouds in file ...loudloadbalancers.features.NodeClientLiveTest.java (2012-10-20)
@@ -22,7 +22,6 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -30,6 +29,8 @@ import java.util.Set;
 import java.util.Map.Entry;
 import java.util.logging.Logger;
 
+import com.google.common.collect.ImmutableSet;
+
 import org.jclouds.cloudloadbalancers.domain.LoadBalancer;
 import org.jclouds.cloudloadbalancers.domain.LoadBalancerRequest;
 import org.jclouds.cloudloadbalancers.domain.Node;
@@ -71,7 +72,7 @@ public class NodeClientLiveTest extends BaseCloudLoadBalancersClientLiveTest {
          String region = lb.getRegion();
          Logger.getAnonymousLogger().info("starting node on loadbalancer " + lb.getId() + " in region " + region);
          Set<Node> newNodes = client.getNodeClient(region).createNodesInLoadBalancer(
-                  Collections.<NodeRequest> singleton(NodeRequest.builder().address("192.168.1.2").port(8080).build()),
+                  ImmutableSet.<NodeRequest> of(NodeRequest.builder().address("192.168.1.2").port(8080).build()),
                   lb.getId());
 
          for (Node n : newNodes) {
Project jclouds/jclouds in file ...louds.nodepool.internal.JsonNodeMetadataStore.java (2012-10-20)
@@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkState;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 
@@ -38,6 +37,7 @@ import org.jclouds.util.Strings2;
 
 import com.google.common.base.Supplier;
 import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -109,7 +109,7 @@ public class JsonNodeMetadataStore implements NodeMetadataStore {
    @Override
    public Set<NodeMetadata> loadAll(Set<NodeMetadata> backendNodes) {
       if (backendNodes == null || backendNodes.isEmpty()) {
-         return Collections.emptySet();
+         return ImmutableSet.of();
       }
       final Set<NodeMetadata> loadedSet = Sets.newLinkedHashSet();
       for (NodeMetadata input : backendNodes) {
Project jclouds/jclouds in file ...cloud.director.v1_5.features.MediaApiLiveTest.java (2012-10-20)
@@ -44,7 +44,6 @@ import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 
 import java.net.URISyntaxException;
-import java.util.Collections;
 import java.util.Set;
 
 import org.jclouds.io.Payloads;
@@ -67,6 +66,7 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Predicates;
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 
 /**
@@ -185,7 +185,7 @@ public class MediaApiLiveTest extends BaseVCloudDirectorApiLiveTest {
    public void testGetMediaOwner() {
       Owner directOwner = mediaApi.getOwner(media.getId());
       assertEquals(owner.toBuilder().user(owner.getUser()).build(),
-               directOwner.toBuilder().links(Collections.<Link> emptySet()).build(), String.format(
+               directOwner.toBuilder().links(ImmutableSet.<Link> of()).build(), String.format(
                         GETTER_RETURNS_SAME_OBJ, "getOwner()", "owner", "media.getOwner()", owner.toString(),
                         directOwner.toString()));
 
Project jclouds/jclouds in file ...r.v1_5.features.admin.AdminCatalogApiLiveTest.java (2012-10-20)
@@ -28,8 +28,6 @@ import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 
-import java.util.Collections;
-
 import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
 import org.jclouds.vcloud.director.v1_5.domain.Checks;
 import org.jclouds.vcloud.director.v1_5.domain.Link;
@@ -44,6 +42,7 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 
 /**
@@ -127,7 +126,7 @@ public class AdminCatalogApiLiveTest extends BaseVCloudDirectorApiLiveTest {
          owner = catalogApi.getOwner(catalog.getId());
          Checks.checkOwner(owner);
          assertTrue(
-                  equal(owner.toBuilder().links(Collections.<Link> emptySet()).build(),
+                  equal(owner.toBuilder().links(ImmutableSet.<Link> of()).build(),
                            newOwner.toBuilder().user(newOwner.getUser()).build()),
                   String.format(OBJ_FIELD_UPDATABLE, CATALOG, "owner"));
       } finally {
Project jclouds/legacy-jclouds in file ...loudloadbalancers.features.NodeClientLiveTest.java (2012-10-20)
@@ -22,7 +22,6 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -30,6 +29,8 @@ import java.util.Set;
 import java.util.Map.Entry;
 import java.util.logging.Logger;
 
+import com.google.common.collect.ImmutableSet;
+
 import org.jclouds.cloudloadbalancers.domain.LoadBalancer;
 import org.jclouds.cloudloadbalancers.domain.LoadBalancerRequest;
 import org.jclouds.cloudloadbalancers.domain.Node;
@@ -71,7 +72,7 @@ public class NodeClientLiveTest extends BaseCloudLoadBalancersClientLiveTest {
          String region = lb.getRegion();
          Logger.getAnonymousLogger().info("starting node on loadbalancer " + lb.getId() + " in region " + region);
          Set<Node> newNodes = client.getNodeClient(region).createNodesInLoadBalancer(
-                  Collections.<NodeRequest> singleton(NodeRequest.builder().address("192.168.1.2").port(8080).build()),
+                  ImmutableSet.<NodeRequest> of(NodeRequest.builder().address("192.168.1.2").port(8080).build()),
                   lb.getId());
 
          for (Node n : newNodes) {