### Question:
PasswordGeneratorServiceImpl implements PasswordGeneratorService { @Override public String generatePassword() { return generatePassword(DEFAULT_PASSWORD_LENGTH); }  @Override String generatePassword(); @Override String generatePassword(final int length);  }### Answer:
@Test public final void shouldReturnValidPassword() throws Exception { String generatedPassword = passwordGeneratorServiceImpl.generatePassword(); Assert.assertEquals(10, generatedPassword.length()); Assert.assertFalse(generatedPassword.contains(" ")); }
@Test public final void shouldReturnValidPasswordWithSpecifiedLenght() throws Exception { int length = 8; String generatedPassword = passwordGeneratorServiceImpl.generatePassword(length); Assert.assertEquals(length, generatedPassword.length()); Assert.assertFalse(generatedPassword.contains(" ")); }