import jdk.internal.value.ValueClass;

public class Test {

    static value class ValueWithOneOoop {
        Object obj1 = null;
    }

    static value class ValueWithTwoOoops {
        Object obj1 = null;
        Object obj2 = null;
    }

    public static void main(String[] args) {
        Object[] array = ValueClass.newNullRestrictedAtomicArray(ValueWithOneOoop.class, 1, new ValueWithOneOoop());
        if (ValueClass.isFlatArray(array)) {
            throw new RuntimeException("Array is flat");
        }
        array = ValueClass.newNullRestrictedAtomicArray(ValueWithTwoOoops.class, 1, new ValueWithTwoOoops());
        if (ValueClass.isFlatArray(array)) {
            throw new RuntimeException("Array is flat");
        }
    }
}
