Search for a Range in java