public static ArrayList<Device> getDevicesList(String in){
		try{
			FileInputStream input = new FileInputStream(in);
			XMLDecoder decoder = new XMLDecoder(input);
			while(result.size() < 3){
				Object obj = decoder.readObject();
				int option = getDeviceCode(obj);
				switch (option) {
				case 1:
					if (containsClass(Smartphone.class)){
						result.add((Smartphone) obj);
					}
					break;
				case 2:
					if (containsClass(DesktopComputer.class)){
						result.add((DesktopComputer) obj);
					}
					break;
				case 3:
					if (containsClass(TabletComputer.class)){
						result.add((TabletComputer) obj);
					}
				default:
					break;
				}
			}
			return result;
		} catch(ArrayIndexOutOfBoundsException e){
			System.out.println("XML doesnt consist nessesary classes");
			System.exit(1);
		} catch (FileNotFoundException e){
			System.out.println("File not found");
			System.exit(1);
		}
		return null;
	}