class CoincheckUtil {
  public static <T> Optional<T> getArg(Object[] args, Class<T> desired) {<FILL_FUNCTION_BODY>}
}

    if (args == null || args.length == 0) {
      return Optional.empty();
    }
    return Stream.of(args)
        .filter(a -> a != null)
        .filter(a -> desired.isAssignableFrom(a.getClass()))
        .map(a -> (T) a)
        .findFirst();
  
<no_super_class>