class SubroutineDeclarationSmoosher implements IndexedSmoosher<String> {

    @Override
    public boolean canSmoosh(final String line) {
        if (line == null) {
            throw new IllegalArgumentException("Line cannot be null.");
        }

        final String normalized = line.trim().toUpperCase(Locale.US);
        if (!normalized.startsWith("DECLARE ")) {
            return false;
        }

        /*
         * In a variable declaration, there will be no parenthesis preceding an equals sign
         */
        final int parenPos = line.indexOf('(');
        if (parenPos < 0) {
            return false;
        }

        if (line.indexOf('=') < parenPos) {
            return false;
        }

        return true;
    }

}