Immutable list builder - Guava

    0

    0

    Java Public Recipes

    newList is a new list that has the contents of both list1 and list2.

    import com.google.common.collect.ImmutableList;
    
    List newList = ImmutableList.builder().addAll(list1).addAll(list2).build();
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.