CommonUtil { public static long makeVmMemoryDivisibleBy4(long memory) { if ((memory % 4) == 0) { return memory; } else { long temp = memory / 4; return temp * 4; } }  static void setOwnerOnlyReadWrite(String filename); static String getConfDir(); static File getConfigurationFile(final String filename, final String typeName); static String readJsonFile(URL fileURL); static String readJsonFile(final String fileName); static String dataFromFile(String filePath); static void gracefulRackTopologyOutput(
         Map<String, String> racksTopology, String filename, String delimeter); static void prettyOutputStrings(List<Object> objs, String fileName, String delimeter); static List<String> inputsConvert(String inputs); static Set<String> inputsConvertSet(String inputs); static String inputsConvert(Set<String> words); static String inputsConvert(Map<K, V> wordsMap); static boolean isBlank(final String str); static String notNull(final String str, final String desStr); static boolean validateVcResourceName(final String input); static boolean validateResourceName(final String input); static boolean validateDistroName(final String input); static boolean validateClusterName(final String input); static boolean validateNodeGroupName(final String input); static boolean validataPathInfo(final String input); static boolean validateVcDataStoreNames(List<String> names); static boolean matchDatastorePattern(Set<String> patterns, Set<String> datastores); static String escapePattern(String pattern); static String getDatastoreJavaPattern(String pattern); static String getUUID(); static long makeVmMemoryDivisibleBy4(long memory); static boolean validateClusterPassword(String password); static boolean passwordContainInvalidCharacter(String password); static String randomString(int count); static String getClusterName(String vmName); static long getVmIndex(String vmName); static Process execCommand(String cmd); static String decode(final String paramName); static String encode(final String paramName); static String getCurrentTimestamp(); static String toHexString(byte[] bytes); static KeyStore loadAppMgrKeyStore(String keystorePath); static boolean validateUrl(String url, List<String> errorMsgs); static String mergeErrorMsgList(List<String> errorMsgs); static String formatWarningMsg(String warningMsg); static boolean checkServerConnection(final String host, final int port, int waitTime); static Object waitForThreadResult(Future<?> result, int waitTime); static boolean validateDnsType(NetworkDnsType dnsType); static void writeFile(File file, String content); static void writeFile(File file, String content, boolean append); static boolean getBooleanFromString(String booleanString, boolean defaultValue); static String getCustomizedSudoCmd(); static StorageRead.DiskScsiControllerType getSystemAndSwapControllerType(); static StorageRead.DiskScsiControllerType getDataDiskControllerType(); static char[] allChars; }
@Test public void testMakeVmMemoryDivisibleBy4() { long max = Long.MAX_VALUE; max = CommonUtil.makeVmMemoryDivisibleBy4(max); assertTrue(max > 0); }