### Question:
HaloUtils { @Api(1.0) public static void hideKeyboard(@Nullable View focusView) { if (focusView != null) { InputMethodManager inputMethodManager = (InputMethodManager) focusView.getContext().getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(focusView.getWindowToken(), 0); } } private  HaloUtils(); @Api(1.0) static boolean isNetworkConnected(Context context); @Api(2.0) static boolean isCharging(@NonNull Context context, @Nullable Intent intent); @Api(1.0) static void hideKeyboard(@Nullable View focusView); @Api(1.0) static void postUI(Runnable runnable); @Api(1.0) static boolean isAvailableForVersion(int sdkVersion); @Api(1.0) @SuppressWarnings("deprecation") static Drawable getDrawable(Context context, @DrawableRes int resource); @Api(1.0) static Uri getUriFromResource(Context context, int resourceId); @Api(1.0) static boolean hasFlag(int flags, int optionFlag); @Api(1.0) static int getArgb(String hexadecimal); @Api(1.0) static boolean isColor(String color); @Api(2.0) static String sha1(@NonNull String origin); @Api(2.0) static String convertToHex(byte[] data); @NonNull @Api(1.3) static String getEventName(@NonNull Context context, @NonNull String eventName); @Api(2.0) static String bytesToHex(@NonNull byte[] bytes); @Api(2.0) static byte[] hexToBytes(@NonNull String data); @Api(2.5) static boolean isServiceRunning(Context context, Class<?> serviceClass);  }### Answer:
@Test public void thatHideSoftwareKeyboard(){ View view = mock(View.class); InputMethodManager inputMethodManager = mock(InputMethodManager.class); when(view.getContext()).thenReturn(mContext); when(mContext.getSystemService(Activity.INPUT_METHOD_SERVICE)).thenReturn(inputMethodManager); when(inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0)).thenReturn(true); HaloUtils.hideKeyboard(view); assertThat(inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0)).isTrue(); }