Here you can find the source of roundUpToPowerOf2Factor(long val, long factor)
public static long roundUpToPowerOf2Factor(long val, long factor)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one public class Main { public static long roundUpToPowerOf2Factor(long val, long factor) { return (val + (factor - 1)) & ~(factor - 1); }/*from www . j a v a 2s .c o m*/ }