gt: 			return 1.5f >= candidate.value;
context: /* This file is part of the db4o object database http://www.db4o.com
  
  Copyright (C) 2004 - 2011  Versant Corporation http://www.versant.com
  
  db4o is free software; you can redistribute it and/or modify it under
  the terms of version 3 of the GNU General Public License as published
  by the Free Software Foundation.
  
  db4o is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  for more details.
  
  You should have received a copy of the GNU General Public License along
  with this program.  If not, see http://www.gnu.org/licenses/. */
  package com.db4o.test.nativequery;
  
  import java.lang.reflect.*;
  import java.util.*;
  
  import com.db4o.*;
  import com.db4o.activation.*;
  import com.db4o.foundation.*;
  import com.db4o.internal.*;
  import com.db4o.internal.query.*;
  import com.db4o.nativequery.expr.*;
  import com.db4o.nativequery.main.*;
  import com.db4o.query.*;
  import com.db4o.ta.*;
  
  import db4ounit.*;
  import db4ounit.extensions.*;
  import db4ounit.extensions.fixtures.*;
  
  
  public class NQRegressionTestCase extends AbstractDb4oTestCase implements OptOutMultiSession {
  	private final static boolean RUN_LOADTIME = true;
  	
  	private static final String CSTR = "Cc";
  	private static final String BSTR = "Ba";
  	private static final String ASTR = "Aa";
  	public final static Integer INTWRAPPER=new Integer(1);
  	public final static Date DATE=new Date(0);
  	private final static Integer PRIVATE_INTWRAPPER=new Integer(1);
  	
  	
  	public static class ConstantHolder {
  		public static Data _prevData = null;
  		
  		public static Data prevData() {
  			return _prevData;
  		}
  	}
  
  	public static abstract class Base {
  		int id;
  		Integer idWrap;
  		
  		public Base(int id) {
  			this.id=id;
  			idWrap=new Integer(id);
  		}
  
  		public int getId() {
  			return id;
  		}
  	}
  	
  	private static class Other extends Base {
  		public Other() {
  			super(1);
  		}
  	}
  	
  	public static class Data extends Base implements Activatable {
  		boolean bool;
  		float value;
  		String name;
  		Data prev;
  		int id2;
  		Boolean boolWrap;
  		java.util.Date curDate;
  		
  		public Data(int id, boolean bool,float value, String name,Data prev, int id2, java.util.Date curDate) {
  			super(id);
  			this.bool=bool;
  			this.boolWrap=new Boolean(bool);
  			this.value=value;
  			this.name = name;
  			this.prev=prev;
  			this.id2=id2;
  			this.curDate = curDate;
  		}
  
  		public float getValue() {
  			return value;
  		}
  
  		public String getName() {
  			return name;
  		}
  		
  		public boolean getBool() {
  			return bool;
  		}
  
  		public Data getPrev() {
  			return prev;
  		}
  
  		public void activate(ActivationPurpose purpose) {
  		}
  
  		public void bind(Activator activator) {
  		}	
  	}
  
  	public static void main(String[] args) {
  		Iterator4 suite=new Db4oTestSuiteBuilder(new Db4oSolo(),NQRegressionTestCase.class).iterator();
  		new ConsoleTestRunner(suite).run();
  	}
  
  	public void store() {
  		java.util.Date date1 = new java.util.Date(0);
  		java.util.Date date2 = new java.util.Date();
  		
  		Data a=new Data(1,false,1.1f,ASTR,null, 0, date1);
  		Data b=new Data(2,false,1.1f,BSTR,a, Integer.MIN_VALUE, date1);
  		Data c=new Data(3,true,2.2f,CSTR,b, Integer.MIN_VALUE, date1);
  		Data cc=new Data(3,false,3.3f,CSTR,null, Integer.MIN_VALUE, date2);
  		ObjectContainer db=db();
  		db.store(a);
  		db.store(b);
  		db.store(c);
  		db.store(cc);
  		db.store(new Other());
  		ConstantHolder._prevData = a;
  	}
  	
  	private abstract static class ExpectingPredicate<E> extends Predicate<E> {
  
  		public ExpectingPredicate() {
  		}
  		
  		public ExpectingPredicate(Class<? extends E> extentType) {
  			super(extentType);
  		}
  
  		public abstract int expected();
  	}	
  
  	private static final class UnconditionalUntypedPredicate extends ExpectingPredicate<Object> {
  		public int expected() { return 5;}
  
  		public boolean match(Object candidate) {
  			return true;
  		}
  	}
  
  	public void testUnconditionalUntyped() throws Exception {
  		assertNQResult(new UnconditionalUntypedPredicate());
  	}
  
  	private static class UnconditionalBaseTypedPredicate extends ExpectingPredicate<Base> {
  		public int expected() { return 5;}
  
  		public boolean match(Base candidate) {
  			return true;
  		}
  	}
  
  	public void testUnconditionalBaseTyped() throws Exception {
  		assertNQResult(new UnconditionalBaseTypedPredicate());
  	}
  
  	private static final class UnconditionalDataTypedPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 4;}
  
  		public boolean match(Data candidate) {
  			return true;
  		}
  	}
  
  	public void testUnconditionalDataTyped() throws Exception {
  		assertNQResult(new UnconditionalDataTypedPredicate());
  	}
  	
  	private static final class UnconditionalUntypedFalsePredicate extends ExpectingPredicate<Object> {
  		public int expected() { return 0; }
  
  		public boolean match(Object candidate) {
  			return false;
  		}
  	}
  
  	// COR-2292
  	public void _testUnconditionalUntypedFalse() throws Exception {
  		assertNQResult(new UnconditionalUntypedFalsePredicate());
  	}
  
  	private static final class BoolFieldPredicate extends ExpectingPredicate<Data> {
  		public int expected() {
  			return 1;
  		}
  
  		public boolean match(Data candidate) {
  			return candidate.bool;
  		}
  	}
  
  	public void testBoolField() throws Exception {
  		assertNQResult(new BoolFieldPredicate());
  	}
  
  	private static final class NegatedBoolFieldPredicate extends ExpectingPredicate<Data> {
  		public int expected() {
  			return 3;
  		}
  
  		public boolean match(Data candidate) {
  			return !candidate.bool;
  		}
  	}
  
  	public void testNegatedBoolField() throws Exception {
  		assertNQResult(new NegatedBoolFieldPredicate());
  	}
  
  	private static final class DataIntFieldConstantComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.id2==0;
  		}
  	}
  
  	public void testDataIntFieldConstantComparison() throws Exception {
  		assertNQResult(new DataIntFieldConstantComparisonPredicate());
  	}
  
  	private static final class BaseIntFieldConstantOneComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.id==1;
  		}
  	}
  
  	public void testBaseIntFieldConstantOneComparison() throws Exception {
  		assertNQResult(new BaseIntFieldConstantOneComparisonPredicate());
  	}
  
  	private static final class BaseIntFieldConstantThreeComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.id==3;
  		}
  	}
  
  	public void testBaseIntFieldConstantThreeComparison() throws Exception {
  		assertNQResult(new BaseIntFieldConstantThreeComparisonPredicate());
  	}
  
  	private static final class FloatFieldConstantOneComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.value==1.1f;
  		}
  	}
  
  	public void testFloatFieldConstantOneComparison() throws Exception {
  		assertNQResult(new FloatFieldConstantOneComparisonPredicate());
  	}
  
  	private static final class FloatFieldConstantThreeComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.value==3.3f;
  		}
  	}
  
  	public void testFloatFieldConstantThreeComparison() throws Exception {
  		assertNQResult(new FloatFieldConstantThreeComparisonPredicate());
  	}
  
  	private static final class StringFieldEqualsAComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.equals(ASTR);
  		}
  	}
  
  	public void testStringFieldEqualsAComparison() throws Exception {
  		assertNQResult(new StringFieldEqualsAComparisonPredicate());
  	}
  
  	private static final class StringFieldEqualsCComparisonPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.equals(CSTR);
  		}
  	}
  
  	public void testStringFieldEqualsCComparison() throws Exception {
  		assertNQResult(new StringFieldEqualsCComparisonPredicate());
  	}
  
  	private static final class StringFieldStartsWithCPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.startsWith("C");
  		}
  	}
  
  	public void testStringFieldStartsWithC() throws Exception {
  		assertNQResult(new StringFieldStartsWithCPredicate());
  	}
  
  	private static final class StringFieldStartsWithAPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 0;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.startsWith("a");
  		}
  	}
  
  	public void testStringFieldStartsWithA() throws Exception {
  		assertNQResult(new StringFieldStartsWithAPredicate());
  	}
  
  	private static final class StringFieldEndsWithLowerCaseAPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.endsWith("a");
  		}
  	}
  
  	public void testStringFieldEndsWithLowerCaseA() throws Exception {
  		assertNQResult(new StringFieldEndsWithLowerCaseAPredicate());
  	}
  
  	private static final class StringFieldEndsWithUpperCaseAPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 0;}
  
  		public boolean match(Data candidate) {
  			return candidate.name.endsWith("A");
  		}
  	}
  
  	public void testStringFieldEndsWithUpperCaseA() throws Exception {
  		assertNQResult(new StringFieldEndsWithUpperCaseAPredicate());
  	}
  
  	private static final class StringFieldStartsWithCNegatedPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return !candidate.name.startsWith("C");
  		}
  	}
  
  	public void testStringFieldStartsWithCNegated() throws Exception {
  		assertNQResult(new StringFieldStartsWithCNegatedPredicate());
  	}
  
  	private static final class IntFieldSmallerTwoPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.id<2;
  		}
  	}
  
  	public void testIntFieldSmallerTwo() throws Exception {
  		assertNQResult(new IntFieldSmallerTwoPredicate());
  	}
  
  	private static final class IntFieldGreaterPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.id>2;
  		}
  	}
  
  	public void testIntFieldGreater() throws Exception {
  		assertNQResult(new IntFieldGreaterPredicate());
  	}
  
  	private static final class IntFieldSmallerEqualsPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  			return candidate.id<=2;
  		}
  	}
  
  	public void testIntFieldSmallerEquals() throws Exception {
  		assertNQResult(new IntFieldSmallerEqualsPredicate());
  	}
  
  	private static final class IntFieldGreaterEqualsPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 3;}
  
  		public boolean match(Data candidate) {
  			return candidate.id>=2;
  		}
  	}
  
  	public void testIntFieldGreaterEquals() throws Exception {
  		assertNQResult(new IntFieldGreaterEqualsPredicate());
  	}
  
  	private static final class FloatFieldGreaterPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 1;}
  
  		public boolean match(Data candidate) {
  			return candidate.value>2.9f;
  		}
  	}
  
  	public void testFloatFieldGreater() throws Exception {
  		assertNQResult(new FloatFieldGreaterPredicate());
  	}
  
  	private static final class FloatFieldSmallerEqualsPredicate extends ExpectingPredicate<Data> {
  		public int expected() { return 2;}
  
  		public boolean match(Data candidate) {
  