public static Collection<InstanceInfo> selectAll(Applications applications) {
        List<InstanceInfo> all = new ArrayList<>();
        for (Application a : applications.getRegisteredApplications()) {
            all.addAll(a.getInstances());
        }
        return all;
    }
@Test
    public void testSelectAllIfNotNullReturnAllInstances() {
        Application application = createSingleInstanceApp("foo", "foo",
                InstanceInfo.ActionType.ADDED);
        Applications applications = createApplications(application);
        applications.addApplication(application);
        Assert.assertEquals(new ArrayList<>(Arrays.asList(
                application.getByInstanceId("foo"),
                application.getByInstanceId("foo"))),
                EurekaEntityFunctions.selectAll(applications));
    }