### Question:
OrientDBClient extends DB { @Override public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { final ODocument document = dictionary.get(key); if (document != null) { for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { document.field(entry.getKey(), entry.getValue()); } document.save(); return Status.OK; } } catch (Exception e) { e.printStackTrace(); } return Status.ERROR; }  @Override void init(); @Override void cleanup(); @Override Status insert(String table, String key, HashMap<String, ByteIterator> values); @Override Status delete(String table, String key); @Override Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result); @Override Status update(String table, String key, HashMap<String, ByteIterator> values); @Override Status scan(String table, String startkey, int recordcount, Set<String> fields,
                     Vector<HashMap<String, ByteIterator>> result);  }### Answer:
@Test public void updateTest() { String preupdateString = "preupdate"; String user0 = "user0"; String user1 = "user1"; String user2 = "user2"; for(String key: Arrays.asList(user0, user1, user2)) { ODocument doc = new ODocument(CLASS); for (int i = 0; i < NUM_FIELDS; i++) { doc.field(FIELD_PREFIX + i, preupdateString); } doc.save(); orientDBDictionary.put(key, doc); } HashMap<String, ByteIterator> updateMap = new HashMap<>(); for (int i = 0; i < NUM_FIELDS; i++) { updateMap.put(FIELD_PREFIX + i, new StringByteIterator(buildDeterministicValue(user1, FIELD_PREFIX + i))); } orientDBClient.update(CLASS, user1, updateMap); ODocument result = orientDBDictionary.get(user0); for (int i = 0; i < NUM_FIELDS; i++) { assertEquals("Assert first row fields contain preupdateString", result.field(FIELD_PREFIX + i), preupdateString); } result = orientDBDictionary.get(user1); for (int i = 0; i < NUM_FIELDS; i++) { assertEquals("Assert updated row fields are correct", result.field(FIELD_PREFIX + i), updateMap.get(FIELD_PREFIX + i).toString()); } result = orientDBDictionary.get(user2); for (int i = 0; i < NUM_FIELDS; i++) { assertEquals("Assert third row fields contain preupdateString", result.field(FIELD_PREFIX + i), preupdateString); } }