public static int twoOperationsParams(int x1, int x2) { SimpleObject obj = new SimpleObject(); obj.addAbs(x1); return(obj.chainedAddAbs(x2).getResult()); }
public static int twoOperationsWithCheck(SimpleObject obj, int x1, int x2) { if (obj == null) { return(-1); } obj.addAbs(x1); return(obj.chainedAddAbs(x2).getResult()); }
public static int fullCoverage(SimpleObject obj, int x1, int x2, int oc) { if (obj == null) { return(-1); } obj.chainedAddAbs(x1).addAbs(x2); if (obj.getResult() == 10 && oc == obj.getOperationCount()) { return(1); } else { return(0); } }
public static int twoOperationsWithNocheck(SimpleObject obj, int x1, int x2) { obj.addAbs(x1); return(obj.chainedAddAbs(x2).getResult()); }