import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
private static boolean isListKey(final StmtContext<?, ?, ?> leafStmtCtx,
final StmtContext<Collection<SchemaNodeIdentifier>, ?, ?> keyStmtCtx) {
for (final SchemaNodeIdentifier keyIdentifier : keyStmtCtx.coerceStatementArgument()) {
- if (leafStmtCtx.getStatementArgument().equals(keyIdentifier.getLastComponent())) {
+ if (leafStmtCtx.getStatementArgument().equals(Iterables.getLast(keyIdentifier.getNodeIdentifiers()))) {
return true;
}
}