ChangePassword implements IsWidget { boolean validatePasswordsMatch(final String p1, final String p2) { final boolean valid = p1 != null && p1.equals(p2); if (!valid) { showErrorMessage(UsersManagementWidgetsConstants.INSTANCE.passwordsNotMatch()); } return valid; } @Inject  ChangePassword(final ClientUserSystemManager userSystemManager,
                          final Event<NotificationEvent> workbenchNotification,
                          final Event<OnErrorEvent> errorEvent,
                          final Event<ChangePasswordEvent> changePasswordEvent,
                          final View view); @PostConstruct void init(); void show(final String username); void show(final String username,
                     final ChangePasswordCallback callback); void clear(); @Override Widget asWidget(); public View view; }
@Test public void testValidatePasswordMatch() throws Exception { assertTrue(presenter.validatePasswordsMatch("password1", "password1")); assertFalse(presenter.validatePasswordsMatch("password1", "password2")); }