code: public static <T> T firstEntry(final List<T> list) {
          if (list != null && !list.isEmpty()) {
              return list.get(0);
          } else {
              return null;
          }
      }
docs: Extracts the first entry of the list when it is not null and contains values.
  
  @param list The list to extract the first entry from, can be null
  @return The first entry of the list when it is not null or empty, null otherwise