是否有一个好的原生Mac工具来查看Mercurial存储库,类似于Git的gitnub?
这里的示例代码无法在Java 8(1.8.0_40)中编译,但在Eclipse 4.4 JDT独立编译器(Bundle-Version:3.10.0.v20140604-1726)中编译并成功运行:
import java.util.Arrays;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Test method references to local class constructors.
*/
public class LocalClassTest {
public long sumOfLengths(String[] input) {
class Sum {
final long value;
Sum(long value) {
this.value = value;
}
Sum(Sum left, Sum right) {
this.value = left.value + right.value;
}
Sum add(String s) {
return new Sum(value + s.length());
}
}
return Arrays.stream(input)
.reduce(new Sum(0), Sum::add, Sum::new)
.value;
}
static String[] input =
{
"a", "ab", …
Run Code Online (Sandbox Code Playgroud)