SshCredentialVersion extends CredentialVersion { @Override public boolean matchesGenerationParameters(final GenerationParameters generationParameters) { if (generationParameters == null) { return true; } final SshGenerationParameters parameters = (SshGenerationParameters) generationParameters; return parameters.getKeyLength() == getKeyLength() && Objects.equals(parameters.getSshComment(), getComment()); } SshCredentialVersion(final SshCredentialVersionData delegate);  SshCredentialVersion(final SshCredentialVersionData delegate, final SshPublicKeyParser keyParser);  SshCredentialVersion(final String name);  SshCredentialVersion(final SshCredentialValue sshValue, final String name, final Encryptor encryptor); String getPublicKey(); void setPublicKey(final String publicKey); String getPrivateKey(); void setPrivateKey(final String privateKey); @Override void rotate(); @Override boolean matchesGenerationParameters(final GenerationParameters generationParameters); @Override String getCredentialType(); int getKeyLength(); String getComment(); String getFingerprint(); @Override GenerationParameters getGenerationParameters();  }
@Test public void matchesGenerationParameters_returnsFalseWhenParametersDontMatch() { final SshGenerationParameters generationParameters = new SshGenerationParameters(); generationParameters.setKeyLength(4096); assertThat(subject.matchesGenerationParameters(generationParameters), equalTo(false)); }