<?xml version="1.0" encoding="UTF-8"?>
<test-data>
    <test-code>
        <description><![CDATA[
failure case
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 {x.toArray(new Foo[0]);}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
Array dimensioner uses method call, ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 {x.toArray(new Foo[x.size()]);}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
Array dimensioner uses variable, ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 {x.toArray(new Foo[y]);}
}
     ]]></code>
    </test-code>

    <test-code>
        <description>#937 OptimizableToArrayCall does not catch multilevel method chains</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Test {
    public void foo() {
        x.y.toArray(new Foo[0]);
    }
}
        ]]></code>
    </test-code>
</test-data>
