FatLibAnalyzer { Set<String> getArchitectures() throws IOException { if (architectures == null) { BufferedReader br = null; try { br = new BufferedReader(new StringReader(getDetailedLipoInfo())); Set<String> architectures = new HashSet<String>(); for (String line; (line = br.readLine()) != null;) { if (!line.trim().startsWith("architecture")) continue; String[] strings = line.split(" "); if (strings.length < 2) throw new IllegalStateException("Architecture could not be parsed: " + line); String[] architecture = new String[strings.length - 1]; System.arraycopy(strings, 1, architecture, 0, strings.length - 1); architectures.add(StringUtils.join(architecture, " ")); } this.architectures = architectures; } finally { IOUtils.closeQuietly(br); } } return this.architectures; } FatLibAnalyzer(final File fatLib);   }
@Test public void testRetrieveArchitectures() throws Exception { Set<String> architectures = createFatLibAnalyzer().getArchitectures(); assertTrue(architectures.size() == 2); assertTrue(architectures.contains("armv7")); assertTrue(architectures.contains("i386")); }