VpnWatchdog { int getPollTimeout() { if (!enabled) return -1; if (lastPacketReceived < lastPacketSent) return POLL_TIMEOUT_WAITING; return pollTimeout; }    }
@Test public void testGetTimeout() throws Exception { assertEquals(1000, watchdog.getPollTimeout()); watchdog.lastPacketReceived = 1; watchdog.lastPacketSent = 2; assertEquals(7000, watchdog.getPollTimeout()); }