### Question:
UsersVm { public void closeChangePasswordDialog() { zkHelper.findComponent(CHANGE_PASSWORD_DIALOG).detach(); } UsersVm(@Nonnull UserService userService); @Init void init(@ContextParam(ContextType.VIEW) Component component); List<PoulpeUser> getUsers(); int getTotalSize(); @NotifyChange({USERS}) void setActivePage(int activePage); int getActivePage(); @Command @NotifyChange({USERS, TOTAL_SIZE, ACTIVE_PAGE}) void searchUsers(@BindingParam(value = "searchString") String searchString); @Command @NotifyChange({USERS, TOTAL_SIZE, ACTIVE_PAGE, "filteredUsers"}) void filterUsers(@BindingParam(value = "searchString") String searchString); @Command @NotifyChange({USERS, TOTAL_SIZE, ACTIVE_PAGE}) void clearSearch(@BindingParam(value = "searchBox") @Nonnull Textbox searchBox); @Command void editUser(); @Command @NotifyChange({VIEW_DATA_PROP, SELECTED_ITEM_PROP}) void saveUser(@BindingParam(value = "user") PoulpeUser user); @Command @NotifyChange({VIEW_DATA_PROP, SELECTED_ITEM_PROP}) void cancelEdit(); @Command @NotifyChange({USERS}) void sortUsers(@BindingParam("ascending") boolean ascending,
                          @BindingParam("column") String column); boolean isAscendingSort(); void setAscendingSort(boolean ascendingSort); String getColumnOfSorting(); void setColumnOfSorting(String columnOfSorting); PoulpeUser getSelectedUser(); void setSelectedUser(PoulpeUser selectedUser); String getSearchString(); int getItemsPerPage(); List<PoulpeUser> getFilteredUsers(); void setFilteredUsers(List<PoulpeUser> filteredUsers); Validator getEmailValidator(); @Command void showChangePasswordWindow(); @Command void cancelChangePassword(); void closeChangePasswordDialog(); @Command @NotifyChange("confirmPasswordBox") void changePassword(@BindingParam("newPassword") String newPassword, 
                               @BindingParam("confirmedPassword") String confirmedPassword); String getMD5Hash(String password);  }### Answer:
@Test public void testCloseChangePasswordDialog() { Component mockComponent = mock(Component.class); when(zkHelper.findComponent(CHANGE_PASSWORD_DIALOG)).thenReturn(mockComponent); usersVm.closeChangePasswordDialog(); verify(mockComponent).detach(); }