### Question:
MobileModel { @VisibleForTesting boolean parseDescriptor(String descriptor) { if (descriptor != null) { String[] descriptorTokens = descriptor.split(" "); if (descriptorTokens.length >= 1) { String model = descriptorTokens[0]; if (model.equals("iPhone")) { String versionString = descriptorTokens[1]; String[] validVersions = {"X", "XS", "XR"}; if (Arrays.asList(validVersions).contains(versionString)) { return true; } String versionSuffix = ""; if (versionString.matches("\\d[^\\d]")) { versionSuffix = versionString.substring(1); versionString = versionString.substring(0, 1); } else if (versionString.matches("\\d{2}[^\\d]")) { versionSuffix = versionString.substring(2); versionString = versionString.substring(0, 2); } try { int version = Integer.parseInt(versionString); return version > 6 || (version == 6 && versionSuffix.equalsIgnoreCase("s")); } catch (Throwable ignore) { } } else { return (model.equals("iPad")) && descriptorTokens[1].equals("Pro"); } } } return false; } @Inject  MobileModel(); void reset(); void applyKeyAndToken(String keyAndToken); static final String PHONE_SEPARATOR_ESCAPED; static final String PHONE_SEPARATOR_WRITING; }### Answer:
@Test public void testParseDescriptor() { MobileModel mobileModel = new MobileModel(); List<Tuple2<String, Boolean>> list = Arrays.asList( new Tuple2<>("iPod Touch 5", false), new Tuple2<>("iPod Touch 6", false), new Tuple2<>("iPhone 4", false), new Tuple2<>("iPhone 4s", false), new Tuple2<>("iPhone 5", false), new Tuple2<>("iPhone 5c", false), new Tuple2<>("iPhone 5s", false), new Tuple2<>("iPhone 6", false), new Tuple2<>("iPhone 6 Plus", false), new Tuple2<>("iPhone 6s", true), new Tuple2<>("iPhone 6s Plus", true), new Tuple2<>("iPhone 7", true), new Tuple2<>("iPhone 7 Plus", true), new Tuple2<>("iPhone SE", false), new Tuple2<>("iPhone 8", true), new Tuple2<>("iPhone 8 Plus", true), new Tuple2<>("iPhone X", true), new Tuple2<>("iPhone XS", true), new Tuple2<>("iPhone XS Max", true), new Tuple2<>("iPhone XR", true), new Tuple2<>("iPhone 11", true), new Tuple2<>("iPhone 11 Pro", true), new Tuple2<>("iPhone 11 Pro Max", true), new Tuple2<>("iPhone 11S", true), new Tuple2<>("iPad 2", false), new Tuple2<>("iPad 3", false), new Tuple2<>("iPad 4", false), new Tuple2<>("iPad Air", false), new Tuple2<>("iPad Air 2", false), new Tuple2<>("iPad 5", false), new Tuple2<>("iPad 6", false), new Tuple2<>("iPad Mini", false), new Tuple2<>("iPad Mini 2", false), new Tuple2<>("iPad Mini 3", false), new Tuple2<>("iPad Mini 4", false), new Tuple2<>("iPad Pro 9.7 Inch", true), new Tuple2<>("iPad Pro 12.9 Inch", true), new Tuple2<>("iPad Pro 12.9 Inch 2. Generation", true), new Tuple2<>("iPad Pro 10.5 Inch", true) ); list.forEach(tuple -> { log.info(tuple.toString()); assertEquals("tuple: " + tuple, mobileModel.parseDescriptor(tuple.first), tuple.second); }); }