public synchronized boolean maybeUpdatePushRequestTimestamp(long currentTime) {
        /*
         Immediate push request after get subscriptions fetch can be accepted outside push interval
         time as client applies a jitter to the push interval, which might result in a request being
         sent between 0.5 * pushIntervalMs and 1.5 * pushIntervalMs.
        */
        boolean canAccept = lastGetRequestTimestamp > lastPushRequestTimestamp;
        if (!canAccept) {
            long timeElapsedSinceLastMsg = currentTime - lastPushRequestTimestamp;
            canAccept = timeElapsedSinceLastMsg >= pushIntervalMs;
        }

        // Update the timestamp only if the request can be accepted.
        if (canAccept) {
            lastPushRequestTimestamp = currentTime;
        }
        return canAccept;
    }
@Test
    public void testMaybeUpdatePushRequestWithImmediateRetryFail() {
        assertTrue(clientInstance.maybeUpdatePushRequestTimestamp(System.currentTimeMillis()));
        // Second request should be rejected as time since last request is less than the push interval.
        assertFalse(clientInstance.maybeUpdatePushRequestTimestamp(System.currentTimeMillis()));
    }