Java 8 function that always return the same value without regarding to parameter
问题 Is there a predefined Function in Java 8 that does something like this: static <T, R> Function<T, R> constant(R val) { return (T t) -> { return val; }; } To answer people's query on why I need this function here is the real usage when I am trying to parse an integer to an roman numerals: // returns the stream of roman numeral symbol based // on the digit (n) and the exponent (of 10) private static Stream<Symbol> parseDigit(int n, int exp) { if (n < 1) return Stream.empty(); Symbol base =