class StreamApi {

    public static String getLastElementUsingReduce(List<String> valueList) {
        Stream<String> stream = valueList.stream();
        return stream.reduce((first, second) -> second).orElse(null);
    }

}