Java Utililty Methods List Concatenate

List of utility methods to do List Concatenate

Description

The list of methods to do List Concatenate are organized into topic(s).

Method

LongByteConcatenator(List instructionbytes, int num)
Byte Concatenator
long ret = 0;
int size = instructionbytes.size();
for (int i = size - 1; i > (size - 1 - num); i--) {
    ret = ret << 8;
    ret += (0x00000000000000FFL & instructionbytes.get(i));
return ret;
Listconcat(Collection> lists)
Concatenate the collection of lists passed as argument into a new array list.
int size = 0;
for (Collection<T> list : lists) {
    size += list.size();
List<T> result = new ArrayList<T>(size);
for (Collection<T> list : lists) {
    result.addAll(list);
return result;
Listconcat(Collection list1, Collection list2)
concat
List<T> result = new ArrayList<>(list1);
result.addAll(list2);
return result;
byte[]concat(final byte[] result, final List buffers)
concat
if (result == null || result.length == 0)
    return result;
int pos = 0;
for (final byte[] buffer : buffers) {
    System.arraycopy(buffer, 0, result, pos, buffer.length);
    pos += buffer.length;
return result;
...
Listconcat(final Collection... lists)
Concatenates a number of Collections into a single List
ArrayList<T> al = new ArrayList<T>();
for (Collection<? extends T> list : lists)
    if (list != null)
        al.addAll(list);
return al;
Listconcat(final List list1, final List list2)
concat
if (list1 == null || list2 == null)
    throw new NullPointerException("Not initizalized lists");
List<E> concat = new ArrayList<E>(list1.size() + list2.size());
concat.addAll(list1);
concat.addAll(list2);
return concat;
Stringconcat(List list)
concat
if (list.size() > 0) {
    final StringBuilder result = new StringBuilder();
    Iterator iter = list.iterator();
    while (iter.hasNext()) {
        result.append(iter.next().toString());
        if (iter.hasNext()) {
            result.append(".");
    return result.toString();
} else {
    return "";
Listconcat(List l1, List l2)
concat
List<T> list = new ArrayList<>();
list.addAll(l1);
list.addAll(l2);
return list;
Listconcat(List list1, List list2)
concat
if (list1 == null && list2 == null) {
    return null;
final List<T> result = new ArrayList<>();
if (list1 != null)
    result.addAll(list1);
if (list2 != null)
    result.addAll(list2);
...
Stringconcat(List list, String delim)
Used to turn a list into a string with the specified delimiter.
String ret = list.get(0) + "";
for (int i = 1; i < list.size(); i++) {
    ret = ret + delim + list.get(i);
return ret;