Code review comment: it seems we need `value1` only if key is not present should we move it under corresponding `if` to make it lazy?

Code under review:
public MapDataForMapUnion(MapData map1, MapData map2) throws Throwable {
            List<Object> keysList = new ArrayList<>();
            List<Object> valuesList = new ArrayList<>();
            boolean isKeyNullExist = false;
            for (int i = 0; i < map2.size(); i++) {
                Object key = keyElementGetter.getElementOrNull(map2.keyArray(), i);
                if (key == null) {
                    isKeyNullExist = true;
                }
                keysList.add(key);
                valuesList.add(valueElementGetter.getElementOrNull(map2.valueArray(), i));
            }

            for (int i = 0; i < map1.size(); i++) {
                final Object key1 = keyElementGetter.getElementOrNull(map1.keyArray(), i);
                final Object value1 = valueElementGetter.getElementOrNull(map1.valueArray(), i);

                boolean keyExists = false;
                if (key1 != null) {
                    for (int j = 0; j < keysList.size(); j++) {
                        final Object key2 = keysList.get(j);
                        if (key2 != null && (boolean) keyEqualityHandle.invoke(key1, key2)) {
                            
                            keyExists = true;
                            break;
                        }
                    }
                }

                if (isKeyNullExist && key1 == null) {
                    continue;
                }

                
                if (!keyExists) {
                    keysList.add(key1);
                    valuesList.add(value1);
                }
            }
            this.keysArray = new GenericArrayData(keysList.toArray());
            this.valuesArray = new GenericArrayData(valuesList.toArray());
        }

Line commented on: final Object value1 = valueElementGetter.getElementOrNull(map1.valueArray(), i);

Revised code:
public MapDataForMapUnion(MapData map1, MapData map2) throws Throwable {
            List<Object> keysList = new ArrayList<>();
            List<Object> valuesList = new ArrayList<>();
            boolean isKeyNullExist = false;
            ArrayData keyArray2 = map2.keyArray();
            ArrayData valueArray2 = map2.valueArray();
            for (int i = 0; i < map2.size(); i++) {
                Object key = keyElementGetter.getElementOrNull(keyArray2, i);
                if (key == null) {
                    isKeyNullExist = true;
                }
                keysList.add(key);
                valuesList.add(valueElementGetter.getElementOrNull(valueArray2, i));
            }
            ArrayData keyArray1 = map1.keyArray();
            ArrayData valueArray1 = map1.valueArray();
            for (int i = 0; i < map1.size(); i++) {
                final Object key1 = keyElementGetter.getElementOrNull(keyArray1, i);

                boolean keyExists = false;
                if (key1 != null) {
                    for (int j = 0; j < keysList.size(); j++) {
                        final Object key2 = keysList.get(j);
                        if (key2 != null && (boolean) keyEqualityHandle.invoke(key1, key2)) {
                            
                            keyExists = true;
                            break;
                        }
                    }
                }

                if (isKeyNullExist && key1 == null) {
                    continue;
                }

                
                if (!keyExists) {
                    final Object value1 = valueElementGetter.getElementOrNull(valueArray1, i);
                    keysList.add(key1);
                    valuesList.add(value1);
                }
            }
            this.keysArray = new GenericArrayData(keysList.toArray());
            this.valuesArray = new GenericArrayData(valuesList.toArray());
        }