StringUtils { static String getReadableParameters(final List<? extends VariableElement> parameters) { final StringBuilder stringBuilder = new StringBuilder(); if (parameters != null && !parameters.isEmpty()) { for (final VariableElement variableElement : parameters) { final String rawTypeName = variableElement.asType().toString(); final String[] parts = rawTypeName.split("\\."); final String readableType = parts[parts.length - 1]; stringBuilder.append(readableType).append(", "); } stringBuilder.setLength(stringBuilder.length() - 2); } return stringBuilder.toString(); } private  StringUtils();   }
@Test public void getReadableParameters() { assertEquals("", StringUtils.getReadableParameters(null)); assertEquals("", StringUtils.getReadableParameters(Collections.<VariableElement>emptyList())); assertEquals("Intent, Float", StringUtils.getReadableParameters(Arrays.asList(this.createVariableElement("android.content.Intent"), this.createVariableElement("java.lang.Float")))); assertEquals("Intent", StringUtils.getReadableParameters(Collections.singletonList(this.createVariableElement("android.content.Intent")))); }