@Test
public void testCollect() throws Exception {

    APartialFunctionNoThrow<Integer, Double> squareRoot = new APartialFunctionNoThrow<Integer, Double> () {
        @Override public boolean isDefinedAt (Integer param) {
            return param != 0;
        }
        @Override public Double apply (Integer param) {
            return Math.sqrt (param);
        }
    };
    final List<Double> result = ACollectionHelper.collect (Arrays.asList (0, 1, 2, 3, 4), squareRoot);
    assertEquals (4, result.size ());
}