static InMemorySourceFile fromClassName(String className) {
    ClassNameWithPackage classNameWithPackage = ClassNameWithPackage.of(className);
    boolean isPackageSpecified = StringUtils.isNotBlank(classNameWithPackage.packageName);

    StringBuilder sourceCode = new StringBuilder();
    if (isPackageSpecified) {
      sourceCode.append(String.format("package %s;", classNameWithPackage.packageName));
      sourceCode.append(lineSeparator());
    }

    sourceCode.append(String.format("public class %s {}", classNameWithPackage.simpleClassName));

    return new InMemorySourceFile(className, sourceCode.toString());
  }
In-memory representation of the name and source code of a Java class.
geode-junit/src/main/java/org/apache/geode/test/compiler/InMemorySourceFile.java