// get today and clear time of day
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0); // ! clear would not reset the hour of day !
cal.clear(Calendar.MINUTE);
cal.clear(Calendar.SECOND);
cal.clear(Calendar.MILLISECOND);
// get start of this week in milliseconds
cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author liuqian | |
* @date 2018/8/9 10:33 | |
*/ | |
public class StreamFilterTest { | |
@Test | |
public void listStreamFind() { | |
List<Integer> list = Arrays.asList(1, 10, 3, 7, 5); | |
Integer a = list.stream() | |
.filter(x -> x > 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author liuqian | |
* @date 2018/7/2 17:42 | |
*/ | |
public class StringTest { | |
@Test | |
public void heh() { | |
List<Employee> employees = new ArrayList<Employee>() {{ | |
add(new Employee() {{ | |
setUserId("A01"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |