@Test public void test_java() { mockJava(); assertThat(SystemInfo.java()).isEqualTo("Java 1.9 oracle (64-bit)"); when(mockSystem.getProperty("sun.arch.data.model")).thenReturn("32"); assertThat(SystemInfo.java()).isEqualTo("Java 1.9 oracle (32-bit)"); when(mockSystem.getProperty("sun.arch.data.model")).thenReturn(null); assertThat(SystemInfo.java()).isEqualTo("Java 1.9 oracle"); }
public static String java() { StringBuilder sb = new StringBuilder(); sb .append("Java ") .append(system.getProperty("java.version")) .append(" ") .append(system.getProperty("java.vendor")); String bits = system.getProperty("sun.arch.data.model"); if ("32".equals(bits) || "64".equals(bits)) { sb.append(" (").append(bits).append("-bit)"); } return sb.toString(); }
SystemInfo { public static String java() { StringBuilder sb = new StringBuilder(); sb .append("Java ") .append(system.getProperty("java.version")) .append(" ") .append(system.getProperty("java.vendor")); String bits = system.getProperty("sun.arch.data.model"); if ("32".equals(bits) || "64".equals(bits)) { sb.append(" (").append(bits).append("-bit)"); } return sb.toString(); } }
SystemInfo { public static String java() { StringBuilder sb = new StringBuilder(); sb .append("Java ") .append(system.getProperty("java.version")) .append(" ") .append(system.getProperty("java.vendor")); String bits = system.getProperty("sun.arch.data.model"); if ("32".equals(bits) || "64".equals(bits)) { sb.append(" (").append(bits).append("-bit)"); } return sb.toString(); } private  SystemInfo(); }
SystemInfo { public static String java() { StringBuilder sb = new StringBuilder(); sb .append("Java ") .append(system.getProperty("java.version")) .append(" ") .append(system.getProperty("java.vendor")); String bits = system.getProperty("sun.arch.data.model"); if ("32".equals(bits) || "64".equals(bits)) { sb.append(" (").append(bits).append("-bit)"); } return sb.toString(); } private  SystemInfo(); static void setSystem(System2 system); static String getVersion(); static String java(); static String os(); }
SystemInfo { public static String java() { StringBuilder sb = new StringBuilder(); sb .append("Java ") .append(system.getProperty("java.version")) .append(" ") .append(system.getProperty("java.vendor")); String bits = system.getProperty("sun.arch.data.model"); if ("32".equals(bits) || "64".equals(bits)) { sb.append(" (").append(bits).append("-bit)"); } return sb.toString(); } private  SystemInfo(); static void setSystem(System2 system); static String getVersion(); static String java(); static String os();  }