@Override
    public String detect(String identifier) {
      if (identifier.length() <= lengthsOfPrefixAndSuffix) {
        return NOT_DETECTED;
      }

      boolean prefixMatches = prefix.isEmpty() ||
          (identifier.startsWith(prefix) && Ascii.isUpperCase(identifier.charAt(prefix.length())));

      boolean suffixMatches = suffix.isEmpty() || identifier.endsWith(suffix);

      if (prefixMatches && suffixMatches) {
        String detected = identifier.substring(prefix.length(), identifier.length() - suffix.length());
        return prefix.isEmpty()
            ? detected
            : CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, detected);
      }

      return NOT_DETECTED;
    }
@param template template string
@return naming that could be applied or detected following template
generator/src/org/immutables/generator/Naming.java