VersionHelper { public VersionRange range(final int... parts) { checkNotNull(parts); checkArgument(parts.length != 0); StringBuilder buff = new StringBuilder() .append("["); for (int i = 0; i < parts.length; i++) { buff.append(parts[i]); if (i + 1 < parts.length) { buff.append("."); } } buff.append(","); for (int i = 0; i < parts.length; i++) { if (i + 1 == parts.length) { buff.append(parts[i] + 1); } else { buff.append(parts[i]) .append("."); } } buff.append(")"); log.trace("Range pattern: {}", buff); return parseRange(buff.toString()); } VersionHelper(); @VisibleForTesting  VersionHelper(final VersionScheme versionScheme); VersionScheme getScheme(); Version parseVersion(final String version); VersionRange parseRange(final String pattern); VersionRange range(final int... parts); VersionRange before(final int... parts); static final String EARLIEST_SUFFIX; }
@Test public void range() { VersionRange range = underTest.range(1, 2, 3); log(range); assertThat(range.toString(), is("[1.2.3,1.2.4)")); }