/* * Copyright (c) 2013 - present Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ package codetoanalyze.java.checkers; import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.List; public class ImmutableCast { ImmutableList immutableList = ImmutableList.of("a", "b", "c"); List badCastFromField() { return immutableList; } List badCast(ImmutableList list) { return list; } List goodCast(ImmutableList list) { return new ArrayList(list); } }