如何将静态部分添加到 java class in javapoet

How to add static section in to java class in javapoet

有没有办法使用 javapoet 库

将静态代码块添加到 java class
static {
        // whatever code is needed for initialization goes here
    }

TypeSpec.Builder::addStaticBlock. See this test case举例。