Merge "Port CompareUpstreams tool to Java and improve."