@Test public void isWholeNumber_whenBigDecimalFromInteger_returnsTrue() { assertTrue(LineItemBuilder.isWholeNumber(BigDecimal.ZERO)); assertTrue(LineItemBuilder.isWholeNumber(BigDecimal.valueOf(555))); }
static boolean isWholeNumber(BigDecimal number) { return number.remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0; }
LineItemBuilder { static boolean isWholeNumber(BigDecimal number) { return number.remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0; } }
LineItemBuilder { static boolean isWholeNumber(BigDecimal number) { return number.remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0; } LineItemBuilder();   LineItemBuilder(String currencyCode); }
LineItemBuilder { static boolean isWholeNumber(BigDecimal number) { return number.remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0; } LineItemBuilder();   LineItemBuilder(String currencyCode); LineItemBuilder setCurrencyCode(String currencyCode); LineItemBuilder setUnitPrice(long unitPrice); LineItemBuilder setTotalPrice(long totalPrice); LineItemBuilder setQuantity(BigDecimal quantity); LineItemBuilder setQuantity(double quantity); LineItemBuilder setDescription(String description); LineItemBuilder setRole(int role); LineItem build(); }
LineItemBuilder { static boolean isWholeNumber(BigDecimal number) { return number.remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0; } LineItemBuilder();   LineItemBuilder(String currencyCode); LineItemBuilder setCurrencyCode(String currencyCode); LineItemBuilder setUnitPrice(long unitPrice); LineItemBuilder setTotalPrice(long totalPrice); LineItemBuilder setQuantity(BigDecimal quantity); LineItemBuilder setQuantity(double quantity); LineItemBuilder setDescription(String description); LineItemBuilder setRole(int role); LineItem build(); static final Set<Integer> VALID_ROLES; }