Java List xor xorOnLists(List l1, List l2)

Here you can find the source of xorOnLists(List l1, List l2)

Description

xor On Lists

License

Apache License

Declaration

public static <E> List<E> xorOnLists(List<E> l1, List<E> l2) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static <E> List<E> xorOnLists(List<E> l1, List<E> l2) {
        boolean xor = l1 == null ^ l2 == null;
        if (xor) {
            return l1 == null ? l2 : l1;
        }//  w  w  w .  j  a  va  2s  .c o  m
        if (l1 != null) {
            l1.clear();
            return l1;
        }
        return null;
    }
}

Related

  1. xor(List l1, List l2)
  2. xor(List blocs)