Here you can find the source of arrayCounter(T[] x)
public static <T> int arrayCounter(T[] x)
//package com.java2s; //License from project: Open Source License public class Main { public static <T> int arrayCounter(T[] x) { int z = 0; for (int i = 0; i < x.length; i++) { T y = x[i];//from w w w. ja v a2 s .c o m if (y != null) { z++; } } return z; } }