public class UpdateableMongoStore { public void save(Updateable updateable) { if(!updateable.isUpdated()) { System.out.println("new object"); System.out.println(updateable); } else { System.out.println("update an object"); System.out.println(updateable); /* build some update query using `updateable.getUpdates()` */ /* save them to store */ } } /* other store methods */ }