@Test public void replaceNullValueWithEmptyGroup_withNullValues() { final List<String> groups = VersionNumber.replaceNullValueWithEmptyGroup(Arrays.asList(null, null, "1")); assertThat(groups).hasSize(3); assertThat(groups.get(0)).isEqualTo(VersionNumber.EMPTY_GROUP); assertThat(groups.get(1)).isEqualTo(VersionNumber.EMPTY_GROUP); assertThat(groups.get(2)).isEqualTo("1"); }
public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) { Check.notNull(groups, "groups"); final List<String> result = new ArrayList<String>(groups.size()); for (final String group : groups) { if (group == null) { result.add(EMPTY_GROUP); } else { result.add(group); } } for (int i = result.size(); i < MIN_GROUP_SIZE; i++) { result.add(EMPTY_GROUP); } return result; }
VersionNumber implements ReadableVersionNumber, Serializable { public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) { Check.notNull(groups, "groups"); final List<String> result = new ArrayList<String>(groups.size()); for (final String group : groups) { if (group == null) { result.add(EMPTY_GROUP); } else { result.add(group); } } for (int i = result.size(); i < MIN_GROUP_SIZE; i++) { result.add(EMPTY_GROUP); } return result; } }
VersionNumber implements ReadableVersionNumber, Serializable { public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) { Check.notNull(groups, "groups"); final List<String> result = new ArrayList<String>(groups.size()); for (final String group : groups) { if (group == null) { result.add(EMPTY_GROUP); } else { result.add(group); } } for (int i = result.size(); i < MIN_GROUP_SIZE; i++) { result.add(EMPTY_GROUP); } return result; } VersionNumber(@Nonnull final List<String> groups);  VersionNumber(@Nonnull final List<String> groups, @Nonnull final String extension);  VersionNumber(@Nonnull final String major);  VersionNumber(@Nonnull final String major, @Nonnull final String minor);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix,
			@Nonnull final String extension); }
VersionNumber implements ReadableVersionNumber, Serializable { public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) { Check.notNull(groups, "groups"); final List<String> result = new ArrayList<String>(groups.size()); for (final String group : groups) { if (group == null) { result.add(EMPTY_GROUP); } else { result.add(group); } } for (int i = result.size(); i < MIN_GROUP_SIZE; i++) { result.add(EMPTY_GROUP); } return result; } VersionNumber(@Nonnull final List<String> groups);  VersionNumber(@Nonnull final List<String> groups, @Nonnull final String extension);  VersionNumber(@Nonnull final String major);  VersionNumber(@Nonnull final String major, @Nonnull final String minor);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix,
			@Nonnull final String extension); static VersionNumber parseLastVersionNumber(@Nonnull final String text); static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent); static VersionNumber parseVersion(@Nonnull final String version); static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups); @Override int compareTo(@Nullable final ReadableVersionNumber other); @Override boolean equals(final Object obj); @Override String getBugfix(); @Override String getExtension(); @Override List<String> getGroups(); @Override String getMajor(); @Override String getMinor(); @Override int hashCode(); @Nonnull @Override String toString(); @Nonnull @Override String toVersionString(); }
VersionNumber implements ReadableVersionNumber, Serializable { public static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups) { Check.notNull(groups, "groups"); final List<String> result = new ArrayList<String>(groups.size()); for (final String group : groups) { if (group == null) { result.add(EMPTY_GROUP); } else { result.add(group); } } for (int i = result.size(); i < MIN_GROUP_SIZE; i++) { result.add(EMPTY_GROUP); } return result; } VersionNumber(@Nonnull final List<String> groups);  VersionNumber(@Nonnull final List<String> groups, @Nonnull final String extension);  VersionNumber(@Nonnull final String major);  VersionNumber(@Nonnull final String major, @Nonnull final String minor);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix);  VersionNumber(@Nonnull final String major, @Nonnull final String minor, @Nonnull final String bugfix,
			@Nonnull final String extension); static VersionNumber parseLastVersionNumber(@Nonnull final String text); static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent); static VersionNumber parseVersion(@Nonnull final String version); static List<String> replaceNullValueWithEmptyGroup(@Nonnull final List<String> groups); @Override int compareTo(@Nullable final ReadableVersionNumber other); @Override boolean equals(final Object obj); @Override String getBugfix(); @Override String getExtension(); @Override List<String> getGroups(); @Override String getMajor(); @Override String getMinor(); @Override int hashCode(); @Nonnull @Override String toString(); @Nonnull @Override String toVersionString(); static final String EMPTY_EXTENSION; static final String EMPTY_GROUP; static final VersionNumber UNKNOWN; }