Question: I have this code:

```
$( document ).ajaxComplete(function( event, xhr, settings ) {
    console.log('test');
});

```

I opened the chrome network tab and I can see only one entry (status 200).

But the console displays:

```
(28) test

```

Why is it executed this often?

Answer: 
As an optimisation, the JVM caches some `Integer` references (those from -128 to +127) when it starts up.

So an `Integer` equal to 40 will refer to one in that cache. That's why two references with value 40 will compare equal: they are both referring to the same cached object.

Since 400 is outside the cached range, an `Integer` reference set to 400 will not refer to a cached object, so two references with that value will not compare equal.
This is because of the Java Integer cache. When a number is within the cache the reference is intilized to one from the cache instead of making a new object. In your case, 40 is within the cache so the object references are the same, but 400 is outside of the cache so the objects are not the same reference.See [this answer](https://stackoverflow.com/a/3130348/5117760).