Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { private static List<Integer> getElement(int number) { List<Integer> result = new ArrayList(); for (int i = 0; i < 32; i++) { int b = 1 << i; if ((number & b) > 0) { result.add(Integer.valueOf(b)); } } return result; } }