@Test
public void testSortableBase64Sorting() {

  final List<byte[]> sortedBinary = Lists.newArrayList();
  for (int i = 0; i < Short.MAX_VALUE; i += 100) {
    final byte[] bytes = new byte[2];
    bytes[1] = (byte) (i & 0xff);
    bytes[0] = (byte) ((i >> 8) & 0xff);
    sortedBinary.add(bytes);
  }
  for (int i = Short.MIN_VALUE; i < 0; i += 100) {
    final byte[] bytes = new byte[2];
    bytes[1] = (byte) (i & 0xff);
    bytes[0] = (byte) ((i >> 8) & 0xff);
    sortedBinary.add(bytes);
  }
  verifySorted(sortedBinary);
  final List<byte[]> encodedBinary =
      Lists.transform(sortedBinary, (binary) -> DynamoDBUtils.encodeSortableBase64(binary));
  verifySorted(encodedBinary);
}