private static void assertValidation(
      final String error,
      final String code,
      final boolean returning,
      final int... codeSectionSizes) {
    Bytes codeBytes = Bytes.fromHexString(code);
    for (int i : codeSectionSizes) {
      CodeSection[] codeSections = new CodeSection[i];
      Arrays.fill(codeSections, new CodeSection(1, 0, returning ? 0 : 0x80, 1, 1));
      EOFLayout testLayout =
          new EOFLayout(
              codeBytes,
              1,
              codeSections,
              new EOFLayout[0],
              0,
              Bytes.EMPTY,
              error,
              new AtomicReference<>());
      assertValidation(error, codeBytes, codeSections[0], testLayout);
    }
  }
These tests focus on code-only validations, which are checked within the code runs themselves.
Tests that depend on the EOF container (such as CallF into other sections) are in EOFLayoutTest.
evm/src/test/java/org/hyperledger/besu/evm/code/CodeV1Test.java