### Question:
RemoveOperation extends PatchOperation { @Override <T> void perform(Object target, Class<T> type) { popValueAtPath(target, path); } RemoveOperation(String path);   }### Answer:
@Test public void removePropertyFromObject() throws Exception { List<Todo> todos = new ArrayList<Todo>(); todos.add(new Todo(1L, "A", false)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); new RemoveOperation("/1/description").perform(todos, Todo.class); assertNull(todos.get(1).getDescription()); }
@Test public void removeItemFromList() throws Exception { List<Todo> todos = new ArrayList<Todo>(); todos.add(new Todo(1L, "A", false)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); new RemoveOperation("/1").perform(todos, Todo.class); assertEquals(2, todos.size()); assertEquals("A", todos.get(0).getDescription()); assertEquals("C", todos.get(1).getDescription()); }