### Question:
Booking { public static Number extractNumber(Object obj) { if (obj == null) { return null; } try { return Double.valueOf(obj.toString()); } catch (Exception e) { } return null; } Booking(TargetingChannel targetingChannel, List<Range> ranges, double price, String advId, long requestCount);  Booking(String id, Map source); static Number extractNumber(Object obj); static Map<String, Booking> buildBookingMap(List<Booking> bookings); static List<String> extractBookingIds(List<Booking> bookings); String getId(); List<String> getDays(); String getBookingId(); String getAdvId(); Double getPrice(); Long getAmount(); TargetingChannel getQuery();  }### Answer:
@Test public void extractNumber() { Object obj = null; Number num = Booking.extractNumber(obj); assertNull(num); obj = "1234"; num = Booking.extractNumber(obj); assertEquals(1234.0, num); obj = 123456789; num = Booking.extractNumber(obj); assertEquals(1.23456789E8, num); obj = -123456789; num = Booking.extractNumber(obj); assertEquals(-1.23456789E8, num); obj = Double.MAX_VALUE + 1; num = Booking.extractNumber(obj); assertEquals(Double.MAX_VALUE + 1, num); obj = Double.MIN_VALUE - 1; num = Booking.extractNumber(obj); assertEquals(Double.MIN_VALUE - 1, num); obj = "12345678901234567890123456789012345678901234567890"; num = Booking.extractNumber(obj); assertEquals(1.2345678901234567E49, num); }