public static IntegerList encodeIntsWith16BitWords(IntegerList data) {
		IntegerList data16 = new IntegerList((int)(data.size()*1.5));
		for (int i = 0; i < data.size(); i++) {
			int v = data.get(i);
			if ( v==-1 ) { // use two max uint16 for -1
				data16.add(0xFFFF);
				data16.add(0xFFFF);
			}
			else if (v <= 0x7FFF) {
				data16.add(v);
			}
			else { // v > 0x7FFF
				if ( v>=0x7FFF_FFFF ) { // too big to fit in 15 bits + 16 bits? (+1 would be 8000_0000 which is bad encoding)
					throw new UnsupportedOperationException("Serialized ATN data element["+i+"] = "+v+" doesn't fit in 31 bits");
				}
				v = v & 0x7FFF_FFFF;					// strip high bit (sentinel) if set
				data16.add((v >> 16) | 0x8000);   // store high 15-bit word first and set high bit to say word follows
				data16.add((v & 0xFFFF)); 		// then store lower 16-bit word
			}
		}
		return data16;
	}
Given a list of integers representing a serialized ATN, encode values too large to fit into 15 bits
 as two 16bit values. We use the high bit (0x8000_0000) to indicate values requiring two 16 bit words.
 If the high bit is set, we grab the next value and combine them to get a 31-bit value. The possible
 input int values are [-1,0x7FFF_FFFF].

		| compression/encoding                         | uint16 count | type            |
		| -------------------------------------------- | ------------ | --------------- |
		| 0xxxxxxx xxxxxxxx                            | 1            | uint (15 bit)   |
		| 1xxxxxxx xxxxxxxx yyyyyyyy yyyyyyyy          | 2            | uint (16+ bits) |
		| 11111111 11111111 11111111 11111111          | 2            | int value -1    |

	This is only used (other than for testing) by {@link org.antlr.v4.codegen.model.SerializedJavaATN}
	to encode ints as char values for the java target, but it is convenient to combine it with the
	#decodeIntsEncodedAs16BitWords that follows as they are a pair (I did not want to introduce a new class
	into the runtime). Used only for Java Target.
runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java