### Question:
Node implements Bounded, Comparable<Node> { public Node update(final ObjectId newId) { return update(newId, bounds().orElse(null)); }  abstract TYPE getType(); abstract String getName(); abstract Optional<ObjectId> getMetadataId(); abstract Map<String, Object> getExtraData(); @Nullable Object getExtraData(String key); final @Override int compareTo(Node o); final @Override int hashCode(); final @Override boolean equals(Object o); @Override String toString(); Node update(final ObjectId newId); Node update(final ObjectId newId, final @Nullable Envelope newBounds);  }### Answer:
@Test public void testUpdate() { ObjectId oId1 = ObjectId.valueOf("abc123000000000000001234567890abcdef0000"); ObjectId oId2 = ObjectId.valueOf("abc123000000000000001234567890abcdef0001"); ObjectId mId = ObjectId.valueOf("abc123000000000000001234567890abcdef0002"); Node node = RevObjectFactory.defaultInstance().createNode("Points.1", oId1, ObjectId.NULL, TYPE.FEATURE, null, null); Node updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId()); assertFalse(node.bounds().isPresent()); assertFalse(updated.bounds().isPresent()); assertEquals(node.getMetadataId(), updated.getMetadataId()); assertEquals(node.getName(), updated.getName()); assertEquals(node.getType(), updated.getType()); node = RevObjectFactory.defaultInstance().createNode("Points.1", oId1, ObjectId.NULL, TYPE.FEATURE, new Envelope(0, 1, 2, 3), null); updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId()); assertEquals(node.bounds().get(), updated.bounds().get()); assertEquals(node.getMetadataId(), updated.getMetadataId()); assertEquals(node.getName(), updated.getName()); assertEquals(node.getType(), updated.getType()); node = RevObjectFactory.defaultInstance().createNode("Points.1", oId1, mId, TYPE.FEATURE, null, null); updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId()); assertFalse(node.bounds().isPresent()); assertFalse(updated.bounds().isPresent()); assertEquals(node.getMetadataId(), updated.getMetadataId()); assertEquals(node.getName(), updated.getName()); assertEquals(node.getType(), updated.getType()); }