Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Migrate your code from legacy Guava to Java 8

Travis CI Build Status Javadocs Quality Gate

Guava was great library for Java 7 users. But now we have Java 8 and it has many useful features like Optional, Stream and Lambda. So some features in Guava should be replaced with them.

Other parts in Guava are useful even for Java 8, especially collections. But Guava is designed for Java 6+, so it does not provide for Guava collections. So when you want to collect stream to Guava collections, you need some hack which makes your code nonintuitive.

This toolset solves these two problems. For former problem, this toolset provides SpotBugs plugin which reports dependency on deprecated Guava classes. For latter problem, this toolset provides GuavaCollectors class which provides many instances for Guava collections.

This toolset will help your development with Java 8 and good parts of Guava library.

SpotBugs plugin

SpotBugs plugin helps developer to find dependency on deprecated guava classes, which should be replaced with Java 8. List of deprecated guava classes is in

To use this module in your Maven project, please add following configuration to your pom.xml.


Helper module

Helper module provides collectors which is useful to use Guava with Java 8.

ImmutableMap<String, Integer> map = Stream.of(1, 2)
        .collect(GuavaCollectors.toImmutableMap(Object::toString, UnaryOperator.identity()));

See and its test cases for detail usage. To use this module in your Maven project, please add following configuration to your pom.xml.


SonarQube plugin

See sonarqube-plugin/ for detail.

Change set

Please visit release page.

Copyright and license

Copyright 2015-2019 Kengo TODA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.