code: public static <T> T first(Iterable<T> objects) {
          if (objects != null) {
              for (T object : objects) {
                  return object;
              }
          }
          return null;
      }
docs: Returns the first item in the given collection