Move static factory methods to the utility class

Change-Id: Icf458adf78f51823e4ffa31346595fa9716485bf
diff --git a/core/api/src/test/java/org/onosproject/net/newresource/ResourceAllocationTest.java b/core/api/src/test/java/org/onosproject/net/newresource/ResourceAllocationTest.java
index c8c1b17..4a5a450 100644
--- a/core/api/src/test/java/org/onosproject/net/newresource/ResourceAllocationTest.java
+++ b/core/api/src/test/java/org/onosproject/net/newresource/ResourceAllocationTest.java
@@ -32,9 +32,9 @@
 
     @Test
     public void testEquals() {
-        ResourceAllocation alloc1 = new ResourceAllocation(Resource.discrete(D1, P1, VLAN1).resource(), IID1);
-        ResourceAllocation sameAsAlloc1 = new ResourceAllocation(Resource.discrete(D1, P1, VLAN1).resource(), IID1);
-        ResourceAllocation alloc2 = new ResourceAllocation(Resource.discrete(D2, P1, VLAN1).resource(), IID1);
+        ResourceAllocation alloc1 = new ResourceAllocation(Resources.discrete(D1, P1, VLAN1).resource(), IID1);
+        ResourceAllocation sameAsAlloc1 = new ResourceAllocation(Resources.discrete(D1, P1, VLAN1).resource(), IID1);
+        ResourceAllocation alloc2 = new ResourceAllocation(Resources.discrete(D2, P1, VLAN1).resource(), IID1);
 
         new EqualsTester()
                 .addEqualityGroup(alloc1, sameAsAlloc1)
diff --git a/core/api/src/test/java/org/onosproject/net/newresource/ResourceIdTest.java b/core/api/src/test/java/org/onosproject/net/newresource/ResourceIdTest.java
index 1d2257b..aa97892 100644
--- a/core/api/src/test/java/org/onosproject/net/newresource/ResourceIdTest.java
+++ b/core/api/src/test/java/org/onosproject/net/newresource/ResourceIdTest.java
@@ -32,20 +32,20 @@
 
     @Test
     public void testDiscreteToString() {
-        ResourceId resource = Resource.discrete(D1, P1).id();
+        ResourceId resource = Resources.discrete(D1, P1).id();
 
         assertThat(resource.toString(), is(Arrays.asList(D1, P1).toString()));
     }
 
     @Test
     public void testContinuousToString() {
-        ResourceId resource = Resource.continuous(D1, P1, Bandwidth.class).id();
+        ResourceId resource = Resources.continuous(D1, P1, Bandwidth.class).id();
 
         assertThat(resource.toString(), is(Arrays.asList(D1, P1, Bandwidth.class.getSimpleName()).toString()));
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testInitWithNonClassInstance() {
-        Resource.continuous(D1, P1, BW1).id();
+        Resources.continuous(D1, P1, BW1).id();
     }
 }
diff --git a/core/api/src/test/java/org/onosproject/net/newresource/ResourceTest.java b/core/api/src/test/java/org/onosproject/net/newresource/ResourceTest.java
index a14b947..59f327f 100644
--- a/core/api/src/test/java/org/onosproject/net/newresource/ResourceTest.java
+++ b/core/api/src/test/java/org/onosproject/net/newresource/ResourceTest.java
@@ -39,11 +39,11 @@
 
     @Test
     public void testEquals() {
-        Resource resource1 = Resource.discrete(D1, P1, VLAN1).resource();
-        Resource sameAsResource1 = Resource.discrete(D1, P1, VLAN1).resource();
-        Resource resource2 = Resource.discrete(D2, P1, VLAN1).resource();
-        Resource resource3 = Resource.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
-        Resource sameAsResource3 = Resource.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
+        Resource resource1 = Resources.discrete(D1, P1, VLAN1).resource();
+        Resource sameAsResource1 = Resources.discrete(D1, P1, VLAN1).resource();
+        Resource resource2 = Resources.discrete(D2, P1, VLAN1).resource();
+        Resource resource3 = Resources.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
+        Resource sameAsResource3 = Resources.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
 
         new EqualsTester()
                 .addEqualityGroup(resource1, sameAsResource1)
@@ -54,19 +54,19 @@
 
     @Test
     public void testComponents() {
-        Resource port = Resource.discrete(D1, P1).resource();
+        Resource port = Resources.discrete(D1, P1).resource();
 
         assertThat(port.components(), contains(D1, P1));
     }
 
     @Test
     public void testIdEquality() {
-        ResourceId id1 = Resource.discrete(D1, P1, VLAN1).id();
-        ResourceId sameAsId1 = Resource.discrete(D1, P1, VLAN1).id();
-        ResourceId id2 = Resource.discrete(D2, P1, VLAN1).id();
-        ResourceId id3 = Resource.continuous(D1, P1, Bandwidth.class).resource(BW1.bps()).id();
+        ResourceId id1 = Resources.discrete(D1, P1, VLAN1).id();
+        ResourceId sameAsId1 = Resources.discrete(D1, P1, VLAN1).id();
+        ResourceId id2 = Resources.discrete(D2, P1, VLAN1).id();
+        ResourceId id3 = Resources.continuous(D1, P1, Bandwidth.class).resource(BW1.bps()).id();
         // intentionally set a different value
-        ResourceId sameAsId3 = Resource.continuous(D1, P1, Bandwidth.class).resource(BW2.bps()).id();
+        ResourceId sameAsId3 = Resources.continuous(D1, P1, Bandwidth.class).resource(BW2.bps()).id();
 
         new EqualsTester()
                 .addEqualityGroup(id1, sameAsId1)
@@ -76,30 +76,30 @@
 
     @Test
     public void testChild() {
-        Resource r1 = Resource.discrete(D1).resource().child(P1);
-        Resource sameAsR2 = Resource.discrete(D1, P1).resource();
+        Resource r1 = Resources.discrete(D1).resource().child(P1);
+        Resource sameAsR2 = Resources.discrete(D1, P1).resource();
 
         assertThat(r1, is(sameAsR2));
     }
 
     @Test
     public void testThereIsParent() {
-        Resource resource = Resource.discrete(D1, P1, VLAN1).resource();
-        Resource parent = Resource.discrete(D1, P1).resource();
+        Resource resource = Resources.discrete(D1, P1, VLAN1).resource();
+        Resource parent = Resources.discrete(D1, P1).resource();
 
         assertThat(resource.parent(), is(Optional.of(parent)));
     }
 
     @Test
     public void testNoParent() {
-        Resource resource = Resource.discrete(D1).resource();
+        Resource resource = Resources.discrete(D1).resource();
 
         assertThat(resource.parent(), is(Optional.of(Resource.ROOT)));
     }
 
     @Test
     public void testBase() {
-        Resource resource = Resource.discrete(D1).resource();
+        Resource resource = Resources.discrete(D1).resource();
 
         DeviceId child = (DeviceId) resource.last();
         assertThat(child, is(D1));
@@ -107,7 +107,7 @@
 
     @Test
     public void testVolumeOfDiscrete() {
-        Resource resource = Resource.discrete(D1).resource();
+        Resource resource = Resources.discrete(D1).resource();
 
         DeviceId volume = resource.volume();
         assertThat(volume, is(D1));
@@ -115,7 +115,7 @@
 
     @Test
     public void testVolumeOfContinuous() {
-        Resource resource = Resource.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
+        Resource resource = Resources.continuous(D1, P1, Bandwidth.class).resource(BW1.bps());
 
         double volume = resource.volume();
         assertThat(volume, is(BW1.bps()));