@Test public void testHashCode() { final Set<Integer> hashCodes = new HashSet<Integer>(); final TerminalProperties.TerminalPropertiesBuilder builder = TerminalProperties.getNewBuilder(); builder.setSkipEnvset(true).setOsPromptPattern("osPromptPattern").setCclPromptPattern("cclPromptPattern") .setCclLoginPromptPattern("cclLoginPromptPattern") .setCclLoginSuccessPromptPattern("cclLoginSuccessPromptPattern").setCclLoginFailurePromptPatterns(null) .setCclLoginFailurePromptPatterns(Arrays.asList(new String[] { "pattern1", "pattern2" })) .setExpectationTimeout(1492).setLogfileLocation("output.log"); hashCodes.add(builder.build().hashCode()); builder.setOsPromptPattern("osPromptPattern2"); hashCodes.add(builder.build().hashCode()); builder.setCclPromptPattern("cclPromptPattern2"); hashCodes.add(builder.build().hashCode()); builder.setCclLoginPromptPattern("cclLoginPromptPattern2"); hashCodes.add(builder.build().hashCode()); builder.setCclLoginSuccessPromptPattern("cclLoginSuccessPromptPattern2"); hashCodes.add(builder.build().hashCode()); builder.setCclLoginFailurePromptPatterns(Arrays.asList(new String[] { "pattern1a", "pattern2a" })); hashCodes.add(builder.build().hashCode()); builder.setSkipEnvset(false); hashCodes.add(builder.build().hashCode()); builder.setExpectationTimeout(999); hashCodes.add(builder.build().hashCode()); builder.setSpecifyDebugCcl(false); hashCodes.add(builder.build().hashCode()); builder.setLogfileLocation("logfile.dat"); hashCodes.add(builder.build().hashCode()); assertThat(hashCodes.size()).isEqualTo(10); }
@Override public int hashCode() { return new HashCodeBuilder(17, 37).append(skipEnvset).append(osPromptPattern).append(cclPromptPattern) .append(cclLoginPromptPattern).append(cclLoginSuccessPromptPattern) .append(cclLoginFailurePromptPatterns).append(expectationTimeout).append(logfileLocation) .append(specifyDebugCcl).toHashCode(); }
TerminalProperties { @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(skipEnvset).append(osPromptPattern).append(cclPromptPattern) .append(cclLoginPromptPattern).append(cclLoginSuccessPromptPattern) .append(cclLoginFailurePromptPatterns).append(expectationTimeout).append(logfileLocation) .append(specifyDebugCcl).toHashCode(); } }
TerminalProperties { @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(skipEnvset).append(osPromptPattern).append(cclPromptPattern) .append(cclLoginPromptPattern).append(cclLoginSuccessPromptPattern) .append(cclLoginFailurePromptPatterns).append(expectationTimeout).append(logfileLocation) .append(specifyDebugCcl).toHashCode(); } private  TerminalProperties(); private  TerminalProperties(final TerminalPropertiesBuilder builder); }
TerminalProperties { @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(skipEnvset).append(osPromptPattern).append(cclPromptPattern) .append(cclLoginPromptPattern).append(cclLoginSuccessPromptPattern) .append(cclLoginFailurePromptPatterns).append(expectationTimeout).append(logfileLocation) .append(specifyDebugCcl).toHashCode(); } private  TerminalProperties(); private  TerminalProperties(final TerminalPropertiesBuilder builder); static String constructDefaultOsPromptPattern(final String host, final String environment,
            final String username); static TerminalPropertiesBuilder getNewBuilder(); boolean getSkipEnvset(); String getOsPromptPattern(); String getCclPromptPattern(); String getCclLoginPromptPattern(); String getCclLoginSuccessPromptPattern(); List<String> getCclLoginFailurePromptPatterns(); long getExpectationTimeout(); boolean getSpecifyDebugCcl(); String getLogfileLocation(); @Override boolean equals(final Object obj); @Override int hashCode(); static void setGlobalTerminalProperties(final TerminalProperties terminalProperties); static TerminalProperties getGlobalTerminalProperties(); }
TerminalProperties { @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(skipEnvset).append(osPromptPattern).append(cclPromptPattern) .append(cclLoginPromptPattern).append(cclLoginSuccessPromptPattern) .append(cclLoginFailurePromptPatterns).append(expectationTimeout).append(logfileLocation) .append(specifyDebugCcl).toHashCode(); } private  TerminalProperties(); private  TerminalProperties(final TerminalPropertiesBuilder builder); static String constructDefaultOsPromptPattern(final String host, final String environment,
            final String username); static TerminalPropertiesBuilder getNewBuilder(); boolean getSkipEnvset(); String getOsPromptPattern(); String getCclPromptPattern(); String getCclLoginPromptPattern(); String getCclLoginSuccessPromptPattern(); List<String> getCclLoginFailurePromptPatterns(); long getExpectationTimeout(); boolean getSpecifyDebugCcl(); String getLogfileLocation(); @Override boolean equals(final Object obj); @Override int hashCode(); static void setGlobalTerminalProperties(final TerminalProperties terminalProperties); static TerminalProperties getGlobalTerminalProperties();  }