MultilineCommentParser (String startDelimiter, String endDelimiter) { if(startDelimiter == null || endDelimiter == null) return null; final String trimmedStart = startDelimiter.trim(); final String trimmedEnd = endDelimiter.trim(); if (trimmedStart.length() > 0 && trimmedEnd.length() > 0) { return new MultilineCommentParser(trimmedStart, trimmedEnd); } else { return null; } }