### Question:
DocumentUtil { public static int parseVersion(String revision) throws ConflictException { int ver = -1; try { ver = Integer.parseInt(revision); } catch (NumberFormatException ex) { throw new ConflictException("OrientDB repository expects revisions as int, " + "unable to parse passed revision: " + revision); } return ver; }  static Map<String, Object> toMap(ODocument doc); static ODocument toDocument(Map<String, Object> objModel, ODocument docToPopulate, ODatabaseDocumentTx db, String orientDocClass); static int parseVersion(String revision); final static String TAG_ID; final static String TAG_REV; final static String ORIENTDB_PRIMARY_KEY; }### Answer:
@Test public void parseValidRevision() throws ConflictException { int ver = DocumentUtil.parseVersion("98765"); assertEquals(ver, 98765); }
@Test(expectedExceptions = ConflictException.class) public void parseInvalidRevision() throws ConflictException { int ver = DocumentUtil.parseVersion("some-text-98765"); assertTrue(false, "Parsing of invalid revision must fail, but did not."); }