Helen Thomas go home
Howard Stern suggested that Helen Thomas who had recently offered all Jews to go where they came from to show an example and return to Lebanon, the land of her ancestors.
@SuppressWarnings("serial")
@Test
public void testBuildMap() {
assertEquals(new HashMap<Integer, String>() {{
put(21, "Number 21");
put(42, "Number 42");
put(63, "Number 63");
}},
MapTools.buildMap(Lists.newArrayList(1, 2, 3),
new Function<Integer, Pair<Integer, String>>() {
@Override
public Pair<Integer, String> apply(Integer k) {
return Pair.of(k * 21, "Number " + k * 21);
}
}
)
);
}
@SuppressWarnings("serial")
@Test
public void testIndex() {
assertEquals(new HashMap<String, Integer>() {{
put("Number 1", 1);
put("Number 2", 2);
put("Number 3", 3);
}},
MapTools.index(Lists.newArrayList(1, 2, 3),
new Function<Integer, String>() {
@Override
public String apply(Integer k) {
return "Number " + k;
}
}
)
);
}
new Function<A,B>() {
B apply(A a) {
return a.getId();
}
.index(listOf(a0, a1, a2, a3));