concept integer in category functional programming

This is an excerpt from Manning's book Functional Programming in Java: How functional techniques improve your Java programs.
But the most important notion here is abstraction. Look at the reduce method. It takes as its argument an operation, and uses it to reduce a list to a single value. Here, the operation has two operands of the same type. Except for this, it could be any operation. Consider a list of integers. You could write a sum method to compute the sum of the elements; you could write a product method to compute the product of the elements; or you could write a min or a max method to compute the minimum or the maximum of the list. But you could also use the reduce method for all these computations. This is abstraction. You abstract the part that is common to all operations in the reduce method, and you pass the variable part (the operation) as an argument.
But you could go further. The reduce method is a particular case of a more general method that might produce a result of a different type than the elements of the list. For example, it could be applied to a list of characters to produce a String. You’d need to start from a given value (probably an empty string). In chapters 3 and 5, you’ll learn how to develop this method (called fold). Also note that the reduce method won’t work on an empty list. Think of a list of integers—if you want to compute the sum, you need to have an element to start with. If the list is empty, what should you return? Of course, you know that the result should be 0, but this only works for a sum. It doesn’t work for a product.
public void TestHigherCompose() { Function<Double, Integer> f = a -> (int) (a * 3); Function<Long, Double> g = a -> a + 2.0; assertEquals(Integer.valueOf(9), f.apply((g.apply(1L)))); assertEquals(Integer.valueOf(9), Function.<Long, Double, Integer>higherCompose().apply(f).apply(g).ap ply(1L)); }
Figures 11.1 through 11.7 illustrate insertion of integers 1 through 7 into an initially empty tree. Figure 11.1 shows the insertion of element 1 into the empty tree. Because you’re inserting into an empty tree, the initial color is red. Once the element is inserted, the root is blackened.