updating answer to use guava and process alpha ranges as well as numeric ranges