@Override @SuppressWarnings("unchecked") protected InstanceIdentifier<D> getSpecificId(@Nonnull final InstanceIdentifier<? extends DataObject> currentId, @Nonnull final D current) { final InstanceIdentifier<D> id = (InstanceIdentifier<D>) currentId; // Make sure the key is present if (isWildcarded(id)) { return RWUtils.replaceLastInId(id, new InstanceIdentifier.IdentifiableItem<>(id.getTargetType(), current.key())); } else { return id; } }