### Question:
RequestUtil { public static <T> String resolveResourcePath(Request<T> request){ Class<?> clazz = request.getClass(); Component component = ClassUtil.getClassAnnotationValue(clazz, Path.class, "component", Component.class); String componentPathElement = component.el(); String unresolvedPath = ClassUtil.getClassAnnotationValue(clazz, Path.class, "path", String.class); Map<String, String> patternMap = new HashMap<String, String>(); for(Field field : clazz.getDeclaredFields()){ UrlPath part = field.getAnnotation(UrlPath.class); if(part!=null){ try { String pattern = part.pattern(); field.setAccessible(true); String value = (String) field.get(request); patternMap.put(pattern, value); } catch (Exception e) { throw new RuntimeException(e); } } } Pattern pattern = Pattern.compile("\\$\\{(.*?)*\\}(.*?)"); Matcher matcher = pattern.matcher(unresolvedPath); LinkedHashSet<String> placeholder = new LinkedHashSet<String>(); while(matcher.find()){ placeholder.add(matcher.group()); } for(String key : placeholder){ String found = patternMap.get(key); if(found!=null){ unresolvedPath = unresolvedPath.replace((String)key, found); } } StringBuffer buffer = new StringBuffer(); buffer.append(componentPathElement); buffer.append(unresolvedPath); return buffer.toString(); }  static boolean isValid(Request<T> request); static boolean isValid(Request<T> request, boolean validateSuperclass); static void infixPotentialDefaults(Request<T> request); static void infixPotentialDefaults(Request<T> request, Class<?> targetClazz, boolean infixPotentialValuesOfSuperClass); static String resolveResourcePath(Request<T> request);  }### Answer:
@Test public void testResolveResourcePath() { DeploymentRequest r = new DeploymentRequest(); RequestUtil.infixPotentialDefaults(r); String resolved = RequestUtil.resolveResourcePath(r); Assert.assertTrue(resolved.contains("{")); Assert.assertTrue(resolved.contains("}")); r.setApplicationName("meineApplication"); resolved = RequestUtil.resolveResourcePath(r); Assert.assertFalse(resolved.contains("{")); Assert.assertFalse(resolved.contains("}")); }