@Test public void testConstructorMultipleMinorIssuesSameName() { String minor = "minor"; int finalSeverity = 2; assertThat( new MajorIssueConfig( "major", ImmutableList.of( new MinorIssueConfig(minor, 1, null), new MinorIssueConfig(minor, finalSeverity, null))) .getMinorIssueConfig(minor) .get() .getSeverity(), equalTo(finalSeverity)); }
public Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue) { return Optional.ofNullable(_minorIssueConfigs.get(minorIssue)); }
MajorIssueConfig { public Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue) { return Optional.ofNullable(_minorIssueConfigs.get(minorIssue)); } }
MajorIssueConfig { public Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue) { return Optional.ofNullable(_minorIssueConfigs.get(minorIssue)); } MajorIssueConfig(String majorIssue, List<MinorIssueConfig> minorIssueConfigs);  MajorIssueConfig(String majorIssue, Map<String, MinorIssueConfig> minorIssueConfigs); }
MajorIssueConfig { public Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue) { return Optional.ofNullable(_minorIssueConfigs.get(minorIssue)); } MajorIssueConfig(String majorIssue, List<MinorIssueConfig> minorIssueConfigs);  MajorIssueConfig(String majorIssue, Map<String, MinorIssueConfig> minorIssueConfigs); @Override boolean equals(Object o); MajorIssueConfig delMinorIssueConfig(String minorIssue); @JsonProperty(PROP_MAJOR_ISSUE) @Nonnull String getMajorIssue(); Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue); @JsonIgnore @Nonnull Map<String, MinorIssueConfig> getMinorIssueConfigsMap(); @JsonProperty(PROP_MINOR_ISSUE_CONFIGS) List<MinorIssueConfig> getMinorIssueConfigs(); @Override int hashCode(); MajorIssueConfig put(MinorIssueConfig minorIssueConfig); @Override String toString(); }
MajorIssueConfig { public Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue) { return Optional.ofNullable(_minorIssueConfigs.get(minorIssue)); } MajorIssueConfig(String majorIssue, List<MinorIssueConfig> minorIssueConfigs);  MajorIssueConfig(String majorIssue, Map<String, MinorIssueConfig> minorIssueConfigs); @Override boolean equals(Object o); MajorIssueConfig delMinorIssueConfig(String minorIssue); @JsonProperty(PROP_MAJOR_ISSUE) @Nonnull String getMajorIssue(); Optional<MinorIssueConfig> getMinorIssueConfig(String minorIssue); @JsonIgnore @Nonnull Map<String, MinorIssueConfig> getMinorIssueConfigsMap(); @JsonProperty(PROP_MINOR_ISSUE_CONFIGS) List<MinorIssueConfig> getMinorIssueConfigs(); @Override int hashCode(); MajorIssueConfig put(MinorIssueConfig minorIssueConfig); @Override String toString();  }