static <T> T findFirstValidInput(T[] inputs) {
    for (T input : inputs) {
      if (input != null) {
        return input;
      }
    }

    throw new HadoopIllegalArgumentException(
        "Invalid inputs are found, all being null");
  }
@Test(expected = HadoopIllegalArgumentException.class)
  public void testNoValidInput() {
    byte[][] inputs = new byte[numInputs][];
    CoderUtil.findFirstValidInput(inputs);
  }