### Question:
PlatypusFilesSupport { public static String replaceAnnotationValue(String aContent, String aAnnotationName, String aValue) { Pattern pattern = Pattern.compile(getAnnotatedDocRegexStr(aAnnotationName)); Matcher matcher = pattern.matcher(aContent); boolean found = matcher.find(); if (!found) { pattern = Pattern.compile(getAnnotatedDocRegexStr("(.*)")); matcher = pattern.matcher(aContent); found = matcher.find(); } List<String> list = new ArrayList<>(); if (found) { String docComment = matcher.group(); String[] lines = docComment.split("\r\n"); if (lines.length == 1) { lines = docComment.split("\n"); } if (lines.length > 1) { boolean processed = false; for (int i = 0; i < lines.length; i++) { String line = lines[i]; if (line.contains(aAnnotationName)) { processed = true; String[] tokens = line.split("\\s"); String rightPadding = ""; for (int t = 0; t < tokens.length; t++) { if (tokens[t].endsWith(aAnnotationName)) { if (aValue != null) { if (t < tokens.length - 1) { tokens[t + 1] = aValue; } else { rightPadding = " " + aValue; } } else { tokens[t] = ""; if (t < tokens.length - 1) { tokens[t + 1] = ""; } } } } String tokensStr = StringUtils.join(" ", tokens) + rightPadding; if (!"*".equals(tokensStr.trim())) { list.add(tokensStr); } } else { list.add(line); } } if (!processed && aValue != null) { list.add(list.size() > 2 ? 2 : 1, " * " + aAnnotationName + " " + aValue); } docComment = StringUtils.join(System.getProperty(ClientConstants.LINE_SEPARATOR_PROP_NAME), list.toArray(new String[]{})); return matcher.replaceFirst(docComment); } } list.add("" + System.getProperty(ClientConstants.LINE_SEPARATOR_PROP_NAME)); String docComment = StringUtils.join(System.getProperty(ClientConstants.LINE_SEPARATOR_PROP_NAME), list.toArray(new String[]{})); return docComment + aContent; }  static String getAnnotationValue(String aContent, String aAnnotationName); static String replaceAnnotationValue(String aContent, String aAnnotationName, String aValue);  }### Answer:
@Test public void testReplaceAnnotationValue() { System.out.println("replaceAnnotationValue"); String aContent = ""; String aAnnotationName = "@name"; String aValue = "11111111111111111"; String expResult = ""; String result = PlatypusFilesSupport.replaceAnnotationValue(aContent, aAnnotationName, aValue); assertEquals(expResult, result); aContent = " "; expResult = " "; result = PlatypusFilesSupport.replaceAnnotationValue(aContent, aAnnotationName, aValue); assertEquals(expResult, result); aContent = " "+CRLF + ""; expResult = " "+CRLF + ""; result = PlatypusFilesSupport.replaceAnnotationValue(aContent, aAnnotationName, aValue); assertEquals(expResult, result); aContent = " function test(){} "+CRLF + ""; expResult = "" + ""+CRLF + " function test(){} "+CRLF + ""; result = PlatypusFilesSupport.replaceAnnotationValue(aContent, aAnnotationName, aValue); assertEquals(expResult, result); }