public static int countInstances(Applications applications) {
        int count = 0;
        for (Application application : applications.getRegisteredApplications()) {
            count += application.getInstances().size();
        }
        return count;
    }
@Test
    public void testCountInstancesIfApplicationsHasInstancesReturnSize() {
        Application application = createSingleInstanceApp("foo", "foo",
                InstanceInfo.ActionType.ADDED);
        Applications applications = createApplications(application);
        Assert.assertEquals(1,
                EurekaEntityFunctions.countInstances(applications));
    }