### Question:
Utils { public static int getRegisterSize(BuilderTypeList typeList) { return getRegisterSize(builderTypeListToTypeNames(typeList)); }  static Object buildArray(String internalName, int length); static Object buildArray(String internalName, int length, ClassLoader classLoader); static List<String> builderTypeListToTypeNames(BuilderTypeList typeList); static String buildFieldDescriptor(Field field); static Object castToPrimitive(Object value, String targetType); static String getArrayDimensionString(Object array); static Double getDoubleValue(Object obj); static List<File> getFilesWithSmaliExtension(File file); static Float getFloatValue(Object obj); static Integer getIntegerValue(Object obj); static MethodLocation[] getLocations(BuilderInstruction... instructions); static Long getLongValue(Object obj); static MethodLocation getNextLocation(MethodLocation location, TIntObjectMap<MethodLocation> addressToLocation); static List<String> getParameterTypes(String methodDescriptor); static int getRegisterSize(BuilderTypeList typeList); static int getRegisterSize(Class<?>[] parameterTypes); static int getRegisterSize(List<String> typeNames); static int getRegisterSize(String typeName); static Set<String> getDeclaredAndValueTypeNames(HeapItem item); static void shiftIntegerMapKeys(int startKey, int shift, TIntObjectMap<T> intToObject);  }### Answer:
@Test public void getRegisterSizeWithEmptyListReturnsZero() { List<String> typeNames = new LinkedList<String>(); int expected = 0; int actual = Utils.getRegisterSize(typeNames); assertEquals(expected, actual); }
@Test public void getRegisterSizeWithTwoOneRegisterTypesReturnsTwo() { List<String> typeNames = new LinkedList<String>(); typeNames.add("I"); typeNames.add("J"); typeNames.add("D"); int expected = 5; int actual = Utils.getRegisterSize(typeNames); assertEquals(expected, actual); }
@Test public void getRegisterSizeWithBuilderTypeListReturnsExpectedValue() { List<BuilderTypeReference> types = new LinkedList<BuilderTypeReference>(); BuilderTypeReference typeRef1 = mock(BuilderTypeReference.class); BuilderTypeReference typeRef2 = mock(BuilderTypeReference.class); when(typeRef1.getType()).thenReturn("I"); when(typeRef2.getType()).thenReturn("J"); types.add(typeRef1); types.add(typeRef2); BuilderTypeList typeList = new BuilderTypeList(types); int registerSize = Utils.getRegisterSize(typeList); assertEquals(3, registerSize); }