### Question:
VanillaCpuLayout implements CpuLayout { @NotNull public static VanillaCpuLayout fromProperties(String fileName) throws IOException { return fromProperties(openFile(fileName)); } VanillaCpuLayout(@NotNull List<CpuInfo> cpuDetails); @NotNull static VanillaCpuLayout fromProperties(String fileName); @NotNull static VanillaCpuLayout fromProperties(InputStream is); @NotNull static VanillaCpuLayout fromProperties(@NotNull Properties prop); @NotNull static VanillaCpuLayout fromCpuInfo(); @NotNull static VanillaCpuLayout fromCpuInfo(String filename); @NotNull static VanillaCpuLayout fromCpuInfo(InputStream is); @Override int cpus(); int sockets(); int coresPerSocket(); @Override int threadsPerCore(); @Override int socketId(int cpuId); @Override int coreId(int cpuId); @Override int threadId(int cpuId); @NotNull @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); static final int MAX_CPUS_SUPPORTED; }### Answer:
@Test public void testFromProperties() throws IOException { final InputStream i7 = getClass().getClassLoader().getResourceAsStream("i7.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(i7); assertEquals("0: CpuInfo{socketId=0, coreId=0, threadId=0}\n" + "1: CpuInfo{socketId=0, coreId=1, threadId=0}\n" + "2: CpuInfo{socketId=0, coreId=2, threadId=0}\n" + "3: CpuInfo{socketId=0, coreId=3, threadId=0}\n" + "4: CpuInfo{socketId=0, coreId=0, threadId=1}\n" + "5: CpuInfo{socketId=0, coreId=1, threadId=1}\n" + "6: CpuInfo{socketId=0, coreId=2, threadId=1}\n" + "7: CpuInfo{socketId=0, coreId=3, threadId=1}\n", vcl.toString()); }