Here you can find the source of compareToZeroOrNull(BigDecimal value)
public static int compareToZeroOrNull(BigDecimal value)
//package com.java2s; /*/*from w w w . j a v a 2s .co m*/ * MathUtils.java * * Copyright (c) 1998 - 2006 BusinessTechnology, Ltd. * All rights reserved * * This program is the proprietary and confidential information * of BusinessTechnology, Ltd. and may be used and disclosed only * as authorized in a license agreement authorizing and * controlling such use and disclosure * * Millennium Business Suite Anywhere System. * */ import java.math.BigDecimal; public class Main { public static int compareToZeroOrNull(BigDecimal value) { if (value == null) return 0; else return compareToZero(value); } public static int compareToZero(BigDecimal value) { return value.compareTo(BigDecimal.ZERO); } }