Here you can find the source of unsignedLessThan(long a, long b)
static boolean unsignedLessThan(long a, long b)
//package com.java2s; /**//from w ww . jav a 2 s . co m * Copyright 2012-2013 Johns Hopkins University HLTCOE. All rights reserved. * This software is released under the 2-clause BSD license. * See LICENSE in the project root directory. */ public class Main { /** * Return true if a (interepted as an unsigned string of bits) is less than * b (interpreted likewise) */ static boolean unsignedLessThan(long a, long b) { long shifted_a = (a >>> 1); long shifted_b = (b >>> 1); return ((shifted_a == shifted_b) ? ((a & 1) < (b & 1)) : (shifted_a < shifted_b)); } }