### Question:
SpaceUtil { public static Object[] inpAll (Space sp, Object key) { List list = new ArrayList(); Object value; do { value = sp.inp (key); if (value != null) { list.add (value); } } while (value != null); return list.toArray(); }  static Object[] inpAll(Space sp, Object key); static void wipe(Space sp, Object key); static void wipeAndOut(Space sp, Object key, Object value); static void wipeAndOut(Space sp, Object key, Object value, long timeout); static long nextLong(Space sp, Object key); static boolean outIfEmpty(Space sp, Object key, Object value, long nrdTimeout, long outTimeout); static void outWhenEmpty(Space sp, Object key, Object value, long timeout); static void outWhenEmpty(Space sp, Object key, Object value);  }### Answer:
@Test public void testInpAll() throws Throwable { Object[] result = SpaceUtil.inpAll(new TSpace(), "testString"); assertEquals(0, result.length, "result.length"); }
@Test public void testInpAllThrowsNullPointerException() throws Throwable { try { SpaceUtil.inpAll(null, ""); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.space.Space.inp(Object)\" because \"sp\" is null", ex.getMessage(), "ex.getMessage()"); } } }