Here you can find the source of toStringIfPresent(LocalDateTime dateTime)
public static String toStringIfPresent(LocalDateTime dateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; public class Main { public static String toStringIfPresent(LocalDateTime dateTime) { if (dateTime != null) { return dateTime.toString(); } else {// w w w .j av a 2 s. co m return null; } } }