This is the sample code piece
public OperationResult beforeEverything(BDDObject savingObject) { String checkAssetRole = doCheckAssetRole(savingObject); if (checkAssetRole != null && !checkAssetRole.equals("MissingAssetRole")) { return new OperationResult(new OperationExecutionError("SIP-37006", new String[] {"Duplicate asset roles have been defined: " + checkAssetRole}, getLocalizationGate())); } ArrayList<String> warnings = new ArrayList<String>(); boolean showWarning = false; if (checkAssetRole != null && checkAssetRole.equals("MissingAssetRole")) { mLogger.debug("Warning of Asset role"); warnings.add(new String( "Asset role is missing. Do you want to save the record?")); showWarning = true; } return OperationResult.OK; } The thing is that doCheckAssetRole method returns null. So how can I handle it in beforeEverything() method. Is there some exception handling to be done? if so, how?