My understanding is that Event.getPath always returns an absolute path, which should be path segments joined by '/'. I don't think there will ever be a terminal '/', and the code here was previously getting the parent node of the property as the Set member, so dropping the property name should be the desired behavior.

In the olden days, there were minor performance gains from sorting the cases in a switch block. This may no longer be the case, but if we were going to change for readability I would want to just use the bitwise comparisons against (NODE_ADDED + NODE_REMOVED + NODE_MOVED) and (PROPERTY_ADDED + ...)