<?xml version="1.0" encoding="UTF-8"?>
<test-data
    xmlns="http://pmd.sourceforge.net/rule-tests"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
    <test-code>
        <description><![CDATA[
1, bad
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 public boolean foo() {
  if (true) {
   return true;
  } else {
   return false;
  }
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
2, bad
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 public boolean foo() {
  if (true)
   return true;
   else
  return false;
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
3, ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public Object foo() {
  if (!true) {
   return null;
  } else {}
  return null;
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
4, ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public void foo() { 
  if (true) {
   return;
  } else {
   return;
  }
 }
}
     ]]></code>
    </test-code>

    <test-code>
        <description>#1320 Enhance SimplifyBooleanReturns checks</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class SimplifyBooleanReturns {
    public boolean exists(Object obj) {
        if (myObjectList.contains(obj)) {
            return true;
        }
        return false;
    }
}
        ]]></code>
    </test-code>
    <test-code>
        <description>#1320 Enhance SimplifyBooleanReturns checks - case 2 without block</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class SimplifyBooleanReturns {
    public boolean exists(Object obj) {
        if (myObjectList.contains(obj))
            return true;
        return false;
    }
}
        ]]></code>
    </test-code>
</test-data>
