AbstractComponentApiServlet extends AbstractApiServlet { protected static Object stringArrayToString(String[] arr) { if (arr.length == 1) { return arr[0]; } else { return arr; } } AbstractComponentApiServlet(
      String componentClass,
      String componentPackage,
      List<String> excludeClass,
      List<String> excludePackage,
      Class<?> clazz); static boolean excludeByPackage(String pkg, List<String> excludePkg); static boolean excludeByClass(Class<?> clazz, List<Class<?>> excludeClazz);  }
@Test public void testStringArrayToString() { Object o1 = AbstractComponentApiServlet.stringArrayToString(new String[] {"Hello"}); assertEquals("Hello", o1); Object o2 = AbstractComponentApiServlet.stringArrayToString(new String[] {"Hello", "World"}); assertEquals(2, ((String[]) o2).length); assertEquals("Hello", ((String[]) o2)[0]); assertEquals("World", ((String[]) o2)[1]); Object o3 = AbstractComponentApiServlet.stringArrayToString(new String[] {}); assertEquals(0, ((String[]) o3).length); }