Ops { public static Object and(TemplateContext ctx, Object value1, final Object value2) { if (!Types.toBoolean(ctx, value1)) { return value1; } return value2; }  static Object and(TemplateContext ctx, Object value1, final Object value2); static Object or(TemplateContext ctx, Object value1, final Object value2); static Object iand(TemplateContext ctx, Object value1, final Object value2); static Object ior(TemplateContext ctx, Object value1, final Object value2); static Object xor(TemplateContext ctx, Object value1, final Object value2); static Object div(TemplateContext ctx, Object value1, final Object value2); static Object mul(TemplateContext ctx, Object value1, final Object value2); static Object mod(TemplateContext ctx, Object value1, final Object value2); static Object binaryPlus(TemplateContext ctx, Object value1, final Object value2); static Object binaryMinus(TemplateContext ctx, Object value1, final Object value2); static Object unaryMinus(TemplateContext ctx, Object value); static Object unaryPlus(TemplateContext ctx, Object value); static long bitwiseNot(TemplateContext ctx, Object value); static boolean booleanNot(TemplateContext ctx, Object value); static long lshift(TemplateContext ctx, Object value, Object count); static long rshift(TemplateContext ctx, Object value, Object count); static Object slice(TemplateContext ctx, Object target, Object startObject, Object endObject, Object strideObject); static Object dot(TemplateContext ctx, Object target, Object child); static Object qdot(TemplateContext ctx, Object target, Object child); static Object pipe(TemplateContext ctx, Object target, Object filterName, Object[] params); static Object invoke(TemplateContext ctx, Object target, Object methodName, Object[] params); static Object newRange(TemplateContext ctx, Object from, Object to); static Object newRangeBy(TemplateContext ctx, Object from, Object to, Object by); static boolean in(TemplateContext ctx, Object o, Object in);  }
@Test public void testAnd() { assertEquals(10, Ops.and(null, 1, 10)); assertEquals(1, Ops.and(null, 10, 1)); assertEquals(10, Ops.and(null, 10, 10)); assertEquals(null, Ops.and(null, null, 10)); assertEquals(0, Ops.and(null, 0, 10)); assertEquals(null, Ops.and(null, 10, null)); assertEquals(0, Ops.and(null, 10, 0)); }