@SuppressWarnings("unchecked")
@Test
public void testInvokeWithTimeParameter() throws RemotingException {

    mockChannel = mock(Channel.class);
    int sleepTime = 2000;
    long start = System.currentTimeMillis();
    String result = handler.telnet(mockChannel, "-t " + sleepTime);
    long end = System.currentTimeMillis();
    assertTrue(result.contains("Application has shutdown successfully") && (end - start) > sleepTime);
}