diff --git a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
index e14e95a..1f45e80 100644
--- a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
+++ b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/PortPairId.java
@@ -16,6 +16,7 @@
 package org.onosproject.vtnrsc;
 
 import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.util.UUID;
 import java.util.Objects;
@@ -32,27 +33,28 @@
      *
      * @param id UUID id of port pair
      */
-    private PortPairId(final UUID id) {
+    private PortPairId(UUID id) {
+        checkNotNull(id, "Port chain id can not be null");
         this.portPairId = id;
     }
 
     /**
-     * Constructor to create port pair id from UUID.
+     * Returns newly created port pair id object.
      *
      * @param id UUID of port pair id
      * @return object of port pair id
      */
-    public static PortPairId portPairId(final UUID id) {
+    public static PortPairId of(UUID id) {
         return new PortPairId(id);
     }
 
     /**
-     * Constructor to create port pair id from string.
+     * Returns newly created port pair id object.
      *
      * @param id port pair id in string
      * @return object of port pair id
      */
-    public static PortPairId portPairId(final String id) {
+    public static PortPairId of(String id) {
         return new PortPairId(UUID.fromString(id));
     }
 
@@ -84,6 +86,8 @@
 
     @Override
     public String toString() {
-        return toStringHelper(this).add("portPairId", portPairId.toString()).toString();
+        return toStringHelper(this)
+                .add("portPairId", portPairId)
+                .toString();
     }
 }
diff --git a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/portpair/PortPairIdTest.java b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/portpair/PortPairIdTest.java
new file mode 100644
index 0000000..f176089
--- /dev/null
+++ b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/portpair/PortPairIdTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.vtnrsc.portpair;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+import org.junit.Test;
+import org.onosproject.vtnrsc.PortPairId;
+
+import com.google.common.testing.EqualsTester;
+import java.util.UUID;
+
+/**
+ * Unit tests for PortPairId class.
+ */
+public class PortPairIdTest {
+
+    final PortPairId portPairId1 = PortPairId.of("78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae");
+    final PortPairId sameAsPortPairId1 = PortPairId.of("78dcd363-fc23-aeb6-f44b-56dc5e2fb3ae");
+    final PortPairId portPairId2 = PortPairId.of("dace4513-24fc-4fae-af4b-321c5e2eb3d1");
+
+    /**
+     * Checks that the PortPairId class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(PortPairId.class);
+    }
+
+    /**
+     * Checks the operation of equals() methods.
+     */
+    @Test
+    public void testEquals() {
+        new EqualsTester().addEqualityGroup(portPairId1, sameAsPortPairId1).addEqualityGroup(portPairId2).testEquals();
+    }
+
+    /**
+     * Checks the construction of a PortPairId object.
+     */
+    @Test
+    public void testConstruction() {
+        final String portPairIdValue = "dace4513-24fc-4fae-af4b-321c5e2eb3d1";
+        final PortPairId portPairId = PortPairId.of(portPairIdValue);
+        assertThat(portPairId, is(notNullValue()));
+        assertThat(portPairId.value(), is(UUID.fromString(portPairIdValue)));
+    }
+}
diff --git a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/resources/PortPairWebResource.java b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/resources/PortPairWebResource.java
index 9194c14..8bf459c 100644
--- a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/resources/PortPairWebResource.java
+++ b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/resources/PortPairWebResource.java
@@ -82,11 +82,11 @@
     @Produces(MediaType.APPLICATION_JSON)
     public Response getPortPair(@PathParam("portPairId") String id) {
 
-        if (!service.exists(PortPairId.portPairId(id))) {
+        if (!service.exists(PortPairId.of(id))) {
             return Response.status(NOT_FOUND)
                     .entity(PORT_PAIR_NOT_FOUND).build();
         }
-        PortPair portPair = nullIsNotFound(service.getPortPair(PortPairId.portPairId(id)),
+        PortPair portPair = nullIsNotFound(service.getPortPair(PortPairId.of(id)),
                                            PORT_PAIR_NOT_FOUND);
 
         ObjectNode result = new ObjectMapper().createObjectNode();
@@ -151,7 +151,7 @@
     @DELETE
     public void deletePortPair(@PathParam("pair_id") String id) {
 
-        PortPairId portPairId = PortPairId.portPairId(id);
+        PortPairId portPairId = PortPairId.of(id);
         Boolean isSuccess = nullIsNotFound(service.removePortPair(portPairId),
                                            PORT_PAIR_NOT_FOUND);
         if (!isSuccess) {
diff --git a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairCodec.java b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairCodec.java
index 7017148..691536f 100644
--- a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairCodec.java
+++ b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairCodec.java
@@ -54,7 +54,7 @@
 
         String id = nullIsIllegal(json.get(ID),
                                   ID + MISSING_MEMBER_MESSAGE).asText();
-        resultBuilder.setId(PortPairId.portPairId(id));
+        resultBuilder.setId(PortPairId.of(id));
 
         String tenantId = nullIsIllegal(json.get(TENANT_ID),
                                         TENANT_ID + MISSING_MEMBER_MESSAGE).asText();
diff --git a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairGroupCodec.java b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairGroupCodec.java
index ef0f3ed..af827a8 100644
--- a/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairGroupCodec.java
+++ b/apps/vtn/vtnweb/src/main/java/org/onosproject/vtnweb/web/PortPairGroupCodec.java
@@ -75,7 +75,7 @@
 
         List<PortPairId> list = Lists.newArrayList();
         ArrayNode arrayNode = (ArrayNode) json.path(PORT_PAIRS);
-        arrayNode.forEach(i -> list.add(PortPairId.portPairId(i.asText())));
+        arrayNode.forEach(i -> list.add(PortPairId.of(i.asText())));
         resultBuilder.setPortPairs(list);
 
         return resultBuilder.build();
