public static Comparator<InstanceInfo> comparatorByAppNameAndId() {
        return INSTANCE_APP_ID_COMPARATOR;
    }
@Test
    public void testComparatorByAppNameAndIdIfNotNullReturnInt() {
        InstanceInfo instanceInfo1 = Mockito.mock(InstanceInfo.class);
        InstanceInfo instanceInfo2 = Mockito.mock(InstanceInfo.class);
        InstanceInfo instanceInfo3 = createSingleInstanceApp("foo", "foo",
                InstanceInfo.ActionType.ADDED).getByInstanceId("foo");
        InstanceInfo instanceInfo4 = createSingleInstanceApp("bar", "bar",
                InstanceInfo.ActionType.ADDED).getByInstanceId("bar");

        Assert.assertTrue(EurekaEntityFunctions.comparatorByAppNameAndId()
                .compare(instanceInfo1, instanceInfo2) > 0);
        Assert.assertTrue(EurekaEntityFunctions.comparatorByAppNameAndId()
                .compare(instanceInfo3, instanceInfo2) > 0);
        Assert.assertTrue(EurekaEntityFunctions.comparatorByAppNameAndId()
                .compare(instanceInfo1, instanceInfo3) < 0);
        Assert.assertTrue(EurekaEntityFunctions.comparatorByAppNameAndId()
                .compare(instanceInfo3, instanceInfo4) > 0);
        Assert.assertTrue(EurekaEntityFunctions.comparatorByAppNameAndId()
                .compare(instanceInfo3, instanceInfo3) == 0);
    }