### Question:
RemoteChangesetVersionCommand extends AbstractCallableCommand<Integer, Exception> { public static String toString(final VersionSpec versionSpec) { if (versionSpec instanceof DateVersionSpec){ final DateVersionSpec dateVersionSpec = (DateVersionSpec) versionSpec; return DateUtil.toString(dateVersionSpec); } else if (versionSpec instanceof LabelVersionSpec) { final LabelVersionSpec labelVersionSpec = (LabelVersionSpec) versionSpec; final String label = labelVersionSpec.getLabel(); final String scope = labelVersionSpec.getScope(); final StringBuilder sb = new StringBuilder(1 + label.length() + Strings.nullToEmpty(scope).length()); sb.append('L'); sb.append(label); if (!Strings.isNullOrEmpty(scope)) { sb.append('@'); sb.append(scope); } return sb.toString(); } return versionSpec.toString(); } RemoteChangesetVersionCommand(
            final ServerConfigurationProvider server, final String remotePath, final VersionSpec versionSpec); Callable<Integer, Exception> getCallable(); Integer call(); static String toString(final VersionSpec versionSpec); String parse(Reader consoleReader);  }### Answer:
@Test public void getVersionSpecificationWhenDateVersionSpec() { final String actual = RemoteChangesetVersionCommand.toString(fixedPointInTime); assertEquals("D2013-07-02T15:40:50Z", actual); }
@Test public void getVersionSpecificationWhenChangesetVersionSpec() { final ChangesetVersionSpec versionSpec = new ChangesetVersionSpec(42); final String actual = RemoteChangesetVersionCommand.toString(versionSpec); assertEquals("C42", actual); }
@Test public void getVersionSpecificationWhenLabelVersionSpecWithoutScope() { final LabelVersionSpec versionSpec = new LabelVersionSpec(new LabelSpec("Foo", null)); final String actual = RemoteChangesetVersionCommand.toString(versionSpec); assertEquals("LFoo", actual); }
@Test public void getVersionSpecificationWhenLabelVersionSpecWithScope() { final LabelVersionSpec versionSpec = new LabelVersionSpec(new LabelSpec("Foo", "$/Bar")); final String actual = RemoteChangesetVersionCommand.toString(versionSpec); assertEquals("LFoo@$/Bar", actual); }