Added getDeviceCount and tests.
diff --git a/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java b/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
index 42b9a31..6c46627 100644
--- a/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
+++ b/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
@@ -14,12 +14,11 @@
 public interface DeviceService {
 
     /**
-     * Returns the current mastership role for the specified device.
+     * Returns the number of infrastructure devices known to the system.
      *
-     * @param deviceId device identifier
-     * @return designated mastership role
+     * @return number of infrastructure devices
      */
-    MastershipRole getRole(DeviceId deviceId);
+    int getDeviceCount();
 
     /**
      * Returns a collection of the currently known infrastructure
@@ -37,6 +36,14 @@
      */
     Device getDevice(DeviceId deviceId);
 
+    /**
+     * Returns the current mastership role for the specified device.
+     *
+     * @param deviceId device identifier
+     * @return designated mastership role
+     */
+    MastershipRole getRole(DeviceId deviceId);
+
 
     /**
      * Returns the list of ports associated with the device.