SysUtils { @Nullable public static String decodeGoSdkArchType(@Nonnull final String osArchProperty) { final String arch = osArchProperty.toLowerCase(Locale.ENGLISH); if (arch.contains("ppc64le")) { return "ppc64le"; } else if (arch.contains("armv6l")) { return "armv6l"; } else if (arch.contains("arm64")) { return "arm64"; } else if (arch.contains("s390")) { return "s390x"; } if (arch.matches("^(x8632|x86|i[3-6]86|ia32|x32)$")) { return "386"; } else if (arch.contains("em64t") || arch.contains("x8664") || arch.contains("ia32e") || arch.contains("x64") || arch.contains("amd64") || arch.contains("x86_64")) { return "amd64"; } return null; } private  SysUtils(); @Nullable static String findGoSdkOsType(); @Nullable static String decodeGoSdkArchType(@Nonnull final String osArchProperty);  }
@Test public void testDecodeGoSdkArchType() { assertNull(SysUtils.decodeGoSdkArchType("some xxx")); assertEquals("armv6l",SysUtils.decodeGoSdkArchType("some armv6l xxx")); assertEquals("ppc64le",SysUtils.decodeGoSdkArchType("ppc ppc64le")); assertEquals("ppc64le",SysUtils.decodeGoSdkArchType("ppc64le")); assertEquals("386",SysUtils.decodeGoSdkArchType("i386")); assertEquals("386",SysUtils.decodeGoSdkArchType("i686")); assertEquals("amd64",SysUtils.decodeGoSdkArchType("amd64")); assertEquals("s390x",SysUtils.decodeGoSdkArchType("s390")); }