XStreamUtils { public static Collection<String> createParentFields(Class<?> clazz, String field, String separator) { Set<String> result = new HashSet<String>(); result.add(clazz.getCanonicalName() + separator + field); Class<?> c = clazz; while (c.getSuperclass() != null) { c = c.getSuperclass(); result.add(c.getCanonicalName() + separator + field); } return result; }  static String toFieldName(String xmlElementName); static String toXmlElementName(String fieldName); static Collection<String> createParentFields(Class<?> clazz, String field, String separator); static boolean setContainsAnyOf(Set<String> toCheck, Collection<String> possibles); static List<String> readResource(InputStream in); static List<Class<?>> getClasses(InputStream in);  }
@Test public void testCreateParentFields() { Collection<String> resultCollection = XStreamUtils.createParentFields(WorkflowImp.class, "serviceCollection", "."); assertTrue(resultCollection.contains("com.adaptris.core.WorkflowImp.serviceCollection")); resultCollection = XStreamUtils.createParentFields(WorkflowImp.class, "serviceCollection", "-"); assertTrue(resultCollection.contains("com.adaptris.core.WorkflowImp-serviceCollection")); }