### Question:
WadlHelper { public static final List<String> toSteps(final Resource resource, final Stack<Resource> ancestors) { final List<String> result = new LinkedList<String>(); for (final Resource ancestor : ancestors) { result.addAll(splitBasedOnFwdSlash(ancestor.getPath())); } result.addAll(splitBasedOnFwdSlash(resource.getPath())); return Collections.unmodifiableList(result); } private  WadlHelper(); static List<Param> getRequestParams(final Method method); static final String computeId(final Method method, final Resource resource, final Resources resources,
            final Application app, final Stack<Resource> ancestors); static final String titleCase(final String text); static final List<T> reverse(final List<T> strings); static final boolean isVersion(final String step); static final String parseTemplateParam(final String step); static final List<String> toSteps(final Resource resource, final Stack<Resource> ancestors); static final boolean isTemplateParam(final String step);  }### Answer:
@Test public void testToSteps() throws Exception { Resource mockResource = mock(Resource.class); when(mockResource.getPath()).thenReturn("students/{id}"); Resource mockAncestorResource = mock(Resource.class); when(mockAncestorResource.getPath()).thenReturn("api/v1"); Stack<Resource> resources = new Stack<Resource>(); resources.push(mockAncestorResource); List<String> steps = WadlHelper.toSteps(mockResource, resources); assertEquals(4, steps.size()); assertEquals("api", steps.get(0)); assertEquals("v1", steps.get(1)); assertEquals("students", steps.get(2)); assertEquals("{id}", steps.get(3)); }