FormatVersion implements Comparable<FormatVersion> { @NotNull public static FormatVersion versionOf(@NotNull DocumentStore store) throws DocumentStoreException { checkNotNull(store); FormatVersion v = V0; Document d = store.find(SETTINGS, VERSION_ID); if (d != null) { Object p = d.get(PROP_VERSION); if (p != null) { try { v = valueOf(p.toString()); } catch (IllegalArgumentException e) { throw new DocumentStoreException(e); } } } return v; } private  FormatVersion(int major, int minor, int micro); static Iterable<FormatVersion> values(); boolean canRead(FormatVersion other); @NotNull static FormatVersion versionOf(@NotNull DocumentStore store); boolean writeTo(@NotNull DocumentStore store); static FormatVersion valueOf(String s); @Override String toString(); @Override boolean equals(Object obj); @Override int compareTo(@NotNull FormatVersion other);  }
@Test public void versionOf() throws Exception { DocumentStore store = new MemoryDocumentStore(); FormatVersion v = FormatVersion.versionOf(store); assertSame(V0, v); }