I think perhaps this is what you're after? The main code loops through all Strings, and then runs each possible "check" on that String in turn. The "check" code itself is stored in an array, which contains objects with a single check(String) method, which is overridden inline. You can make a check() method do anything you need, as long as it works from the standard signature, so if you need regular expression checks or something more complex then that would also work fine.
public class TestTypes
{
    public static void main(String[] args)
    {
        String[] strings = new String[] {"123", "9999999999999", "50.4", "not a number"};
        for(String str : strings)
        {
        System.out.print("'" + str + "': ");
            for( TypeChecker checker : typesToCheck)
            {
                if(checker.check(str))
                {
                    System.out.print(checker.type.getSimpleName() + " ");
                }
            }
            System.out.println();
        }
    }
    static abstract class TypeChecker
    {
        public final Class type;
        public abstract boolean check(String s);
        TypeChecker(Class type)
        {
            this.type = type;
        }
    }
    // A list of the code for all the checks
    static TypeChecker[] typesToCheck = 
    {
            new TypeChecker(Integer.TYPE) // is Integer
            {
                public boolean check(String s)
                {
                    try{Integer.parseInt(s);}
                    catch(Exception e)
                    {return false;}
                    return true;
                }
            },
            new TypeChecker(Long.TYPE) // is Long
            {
                public boolean check(String s)
                {
                    try{Long.parseLong(s);}
                    catch(Exception e)
                    {return false;}
                    return true;
                }
            }, 
            new TypeChecker(Double.TYPE) // is Double
            {
                public boolean check(String s)
                {
                    try{Double.parseDouble(s);}
                    catch(Exception e)
                    {return false;}
                    return true;
                }
            }, 
    };
}
This produces the output:
'123': int long double 
'9999999999999': long double 
'50.4': double 
'not a number': 
This solution is a lot more verbose, and has a level of indirection which has the potential to make it confusing, so if you've only got a small number of possible types, I'd just inline the lot of them and save everyone the trouble!
This sort of approach is only really a good approach if you have complicated algorithms which need to be run in the tests, or if you need to be able to customize which tests are being executed dynamically at runtime.
     
    
switchin the way you are.conditions. You have docs.oracle.com/javase/1.5.0/docs/api/java/lang/… docs to classes like Integer, Double, etc.