export default function addJavaAnnotation(content, { package: packageName, annotation }) {
    if (packageName) {
        if (!new RegExp(`import ${packageName.replace('.', '\\.')}.${annotation};`).test(content)) {
            content = content.replace(/(package [\w.]+;\n)/, `$1import ${packageName}.${annotation};\n`);
        }
    }
    if (!new RegExp(`\n@${annotation}\n`).test(content)) {
        content = content.replace(/\n([a-w ]*(class|@?interface|enum) )/g, `\n@${annotation}\n$1`);
    }
    return content;
}
