Question: I want with this code to check two conditions:

* if I have information but the family is empty display the error message of the label.
* If null information display again the same error message
if not, use the save method (public static ID saveprb) but I have this error

> 
> Method does not exist or incorrect signature: void saveprb() .
> 
> 
> Missing return statement required return type: String
> 
> 
> 

How can I fix this .

```apex
public static String check(Id RecordTypeId) {
    List<check__c> CheckInfo = [SELECT id ,name, Family__c 
                                FROM check__c 
                                WHERE Account__r.id =:RecordTypeId  ]; 
    for (check__c check: CheckInfo ) { 
        String s2 =  System.Label.label1    ; 
        if(CheckInfo .size() < 0) {
            return s2; 
        } else if(CheckInfo .size() > 0 || check.Family__c == null ) {
            return s2; 
        } else{ 
            saveprb(); 
        }
    }
}

```

Answer: 
In normal code, you'd be able to use class variables (static or instance) to hold and access data. If it's static variables, then you could simply access them using `ClassName.staticVariableName`. If it's instance variables, then you'd need to pass an instance into the method the you want to use it in. Pretty standard stuff.

Test classes are different though. Salesforce designed things in a way that means that:

* We can't pass variables in (to test methods)
* All static variables are cleared after your `@testSetup` method runs, but before each `@isTest` method is run (the `testMethod` keyword is deprecated, and should not be used)

In the end, to get at the information you created in your `@testSetup` method, you need to query for it. According to Salesforce, this still saves time over creating test data in every test method.
You need to query the Work\_Order\_\_c object with that Job\_Number\_\_c field . You cannot get directly the data from one method to other methood.

```
 @isTest
public class WorkOrderControllerTest {
    @testSetup static void setup() {
        Work_Order__c WO = New Work_Order__c();
        WO.Job_Number__c = 'Test Job';
        WO.Trading__c = 'Painting';
        WO.Region__c = 'SFO';
        Insert WO;
    }
    static testMethod void test_getPaints(){

    Work_Order__c wro = [SELECT Id FROM Work_Order__c WHERE Job_Number__c ='Test Job' LIMIT 1];
       WorkOrderController.getPaints(wro.id); 
    }
}

```