### Question:
ProtoIndex { public void updatePackageVersion(final String pkg, final SchemaVersion version) { Objects.requireNonNull(pkg); Objects.requireNonNull(version); packageVersions.put(pkg, version); } private  ProtoIndex(final Index index); static ProtoIndex empty(); static ProtoIndex parse(final byte[] bytes); void updateProtoLocation(final String src, final String dest); void updatePackageVersion(final String pkg, final SchemaVersion version); void updateProtoDependencies(final Path proto, final Set<Path> paths); ImmutableSetMultimap<Path, Path> getProtoDependencies(); boolean removeProtoLocation(final String pkg); Map<String, String> getProtoLocations(); Map<String, SchemaVersion> getPackageVersions(); String toProtoString(); @Override String toString(); byte[] toByteArray();  }### Answer:
@Test public void updatePackageVersion() { final ProtoIndex protoIndex = ProtoIndex.empty(); protoIndex.updatePackageVersion("pkg1", SchemaVersion.create("1",0,0)); final ProtoIndex after = ProtoIndex.parse(protoIndex.toByteArray()); assertThat(after.getPackageVersions(), equalTo(ImmutableMap.of( "pkg1", SchemaVersion.create("1",0,0) ))); }