### Question:
UtilFunctions { @CustomFunctionResolver("DensityCustomFunctionResolver0") public static Double Density(List<Tuple> things) { if(things == null || things.size() == 0) return null; double sumDensity = 0.0; int numValidThings = 0; Double density = null; try { for(Tuple t : things) { if(!(t.isNull(WIDTH) || t.isNull(HEIGHT) || t.isNull(DEPTH) || t.isNull(WEIGHTKG))) { double volume = Math.abs(t.getDouble(WIDTH) * t.getDouble(HEIGHT) * t.getDouble(DEPTH)); if(!t.isNull(WEIGHTKG) && volume > 0.0) { sumDensity += t.getDouble(WEIGHTKG) / volume; ++numValidThings; } } } if(numValidThings > 0) density = sumDensity / numValidThings; } catch (StreamBaseException e) { throw new StreamBaseRuntimeException(e.getCause()); } return density; }  @CustomFunctionResolver("DensityCustomFunctionResolver0") static Double Density(List<Tuple> things); static CompleteDataType DensityCustomFunctionResolver0(CompleteDataType things);  }### Answer:
@Test public void testNullList() { List<Tuple> t = null; assertNull(UtilFunctions.Density(t)); }
@Test public void testZeroSize() { List<Tuple> t = new ArrayList<Tuple>(); assertNull(UtilFunctions.Density(t)); }