Here you can find the source of remove(final List
@SuppressWarnings("unused") public static <T> T remove(final List<T> list, final int index, final T defaultValue)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.List; public class Main { @SuppressWarnings("unused") public static <T> T remove(final List<T> list, final int index, final T defaultValue) { return index < list.size() ? list.remove(index) : defaultValue; }/*from w w w. j ava2s. co m*/ }