@Test
public void hideKeyboard() {

    Mockito.when(contextMock.getSystemService(Context.INPUT_METHOD_SERVICE)).thenReturn(inputMethodMock);
    Mockito.when(viewMock.getWindowToken()).thenReturn(binderMock);
    Mockito.when(inputMethodMock.hideSoftInputFromWindow(binderMock, 0)).thenReturn(true);
    Utils.hideKeyboard(contextMock, viewMock);
    Mockito.verify(inputMethodMock).hideSoftInputFromWindow(binderMock, 0);
}